[pLog-svn] r5488 - in plog/trunk: . bin-devel class/action class/action/admin class/config class/controller class/dao class/dao/customfields class/dao/userdata class/data class/data/filter class/file class/gallery/dao class/mail class/misc class/net class/net/xmlrpc class/plugin class/summary/action class/template class/template/smarty/plugins class/test class/test/PHPUnit class/test/PHPUnit/GUI class/test/tests/config class/test/tests/data class/test/tests/data/filter class/test/tests/data/validator class/view/admin flash flash/mp3player gallery install js js/jscalendar js/jscalendar/lang js/jscalendar/skins js/jscalendar/skins/aqua js/tinymce js/tinymce/plugins js/tinymce/plugins/insertaudio js/tinymce/plugins/insertaudio/css js/tinymce/plugins/insertaudio/images js/tinymce/plugins/insertaudio/langs js/tinymce/plugins/insertresource js/tinymce/plugins/insertresource/css js/tinymce/plugins/insertresource/images js/tinymce/plugins/insertresource/langs js/tinymce/plugins/insertv ideo js/tinymce/plugins/insertvideo/css js/tinymce/plugins/insertvideo/images js/tinymce/plugins/insertvideo/langs js/tinymce/plugins/more/langs js/ui locale locale/admin locale/unported templates/LifeType templates/LifeType/en_UK templates/admin templates/admin/chooser templates/rss templates/summary/rss
mark at devel.lifetype.net
mark at devel.lifetype.net
Tue Jun 5 09:51:05 EDT 2007
Author: mark
Date: 2007-06-05 09:51:03 -0400 (Tue, 05 Jun 2007)
New Revision: 5488
Added:
plog/trunk/bin-devel/genmd5.php
plog/trunk/class/action/admin/adminversioncheckaction.class.php
plog/trunk/class/data/filter/
plog/trunk/class/data/filter/allowedhtmlfilter.class.php
plog/trunk/class/data/filter/filterbase.class.php
plog/trunk/class/data/filter/htmlentitiesfilter.class.php
plog/trunk/class/data/filter/htmlfilter.class.php
plog/trunk/class/data/filter/xhtmlizefilter.class.php
plog/trunk/class/misc/integritychecker.class.php
plog/trunk/class/test/tests/config/properties_test.class.php
plog/trunk/class/test/tests/data/filter/
plog/trunk/class/test/tests/data/filter/filterbase_test.class.php
plog/trunk/class/test/tests/data/filter/htmlfilter_test.class.php
plog/trunk/flash/
plog/trunk/flash/mp3player/
plog/trunk/flash/mp3player/mp3player.swf
plog/trunk/gallery/.htaccess
plog/trunk/install/files.properties.php
plog/trunk/js/jscalendar/
plog/trunk/js/jscalendar/ChangeLog
plog/trunk/js/jscalendar/README
plog/trunk/js/jscalendar/calendar-blue.css
plog/trunk/js/jscalendar/calendar-blue2.css
plog/trunk/js/jscalendar/calendar-brown.css
plog/trunk/js/jscalendar/calendar-green.css
plog/trunk/js/jscalendar/calendar-setup.js
plog/trunk/js/jscalendar/calendar-setup_stripped.js
plog/trunk/js/jscalendar/calendar-system.css
plog/trunk/js/jscalendar/calendar-tas.css
plog/trunk/js/jscalendar/calendar-win2k-1.css
plog/trunk/js/jscalendar/calendar-win2k-2.css
plog/trunk/js/jscalendar/calendar-win2k-cold-1.css
plog/trunk/js/jscalendar/calendar-win2k-cold-2.css
plog/trunk/js/jscalendar/calendar.js
plog/trunk/js/jscalendar/calendar.php
plog/trunk/js/jscalendar/calendar_stripped.js
plog/trunk/js/jscalendar/img.gif
plog/trunk/js/jscalendar/lang/
plog/trunk/js/jscalendar/lang/calendar-af.js
plog/trunk/js/jscalendar/lang/calendar-al.js
plog/trunk/js/jscalendar/lang/calendar-bg.js
plog/trunk/js/jscalendar/lang/calendar-big5-utf8.js
plog/trunk/js/jscalendar/lang/calendar-big5.js
plog/trunk/js/jscalendar/lang/calendar-br.js
plog/trunk/js/jscalendar/lang/calendar-ca.js
plog/trunk/js/jscalendar/lang/calendar-cs-utf8.js
plog/trunk/js/jscalendar/lang/calendar-cs-win.js
plog/trunk/js/jscalendar/lang/calendar-da.js
plog/trunk/js/jscalendar/lang/calendar-de.js
plog/trunk/js/jscalendar/lang/calendar-du.js
plog/trunk/js/jscalendar/lang/calendar-el.js
plog/trunk/js/jscalendar/lang/calendar-en.js
plog/trunk/js/jscalendar/lang/calendar-es.js
plog/trunk/js/jscalendar/lang/calendar-fi.js
plog/trunk/js/jscalendar/lang/calendar-fr.js
plog/trunk/js/jscalendar/lang/calendar-he-utf8.js
plog/trunk/js/jscalendar/lang/calendar-hr-utf8.js
plog/trunk/js/jscalendar/lang/calendar-hr.js
plog/trunk/js/jscalendar/lang/calendar-hu.js
plog/trunk/js/jscalendar/lang/calendar-it.js
plog/trunk/js/jscalendar/lang/calendar-jp.js
plog/trunk/js/jscalendar/lang/calendar-ko-utf8.js
plog/trunk/js/jscalendar/lang/calendar-ko.js
plog/trunk/js/jscalendar/lang/calendar-lt-utf8.js
plog/trunk/js/jscalendar/lang/calendar-lt.js
plog/trunk/js/jscalendar/lang/calendar-lv.js
plog/trunk/js/jscalendar/lang/calendar-nl.js
plog/trunk/js/jscalendar/lang/calendar-no.js
plog/trunk/js/jscalendar/lang/calendar-pl-utf8.js
plog/trunk/js/jscalendar/lang/calendar-pl.js
plog/trunk/js/jscalendar/lang/calendar-pt.js
plog/trunk/js/jscalendar/lang/calendar-ro.js
plog/trunk/js/jscalendar/lang/calendar-ru.js
plog/trunk/js/jscalendar/lang/calendar-ru_win_.js
plog/trunk/js/jscalendar/lang/calendar-si.js
plog/trunk/js/jscalendar/lang/calendar-sk.js
plog/trunk/js/jscalendar/lang/calendar-sp.js
plog/trunk/js/jscalendar/lang/calendar-sv.js
plog/trunk/js/jscalendar/lang/calendar-tr.js
plog/trunk/js/jscalendar/lang/calendar-zh-utf8.js
plog/trunk/js/jscalendar/lang/calendar-zh.js
plog/trunk/js/jscalendar/lang/calendar-zh_CN-utf8.js
plog/trunk/js/jscalendar/lang/calendar-zh_TW-utf8.js
plog/trunk/js/jscalendar/lang/cn_utf8.js
plog/trunk/js/jscalendar/menuarrow.gif
plog/trunk/js/jscalendar/menuarrow2.gif
plog/trunk/js/jscalendar/release-notes.html
plog/trunk/js/jscalendar/skins/
plog/trunk/js/jscalendar/skins/aqua/
plog/trunk/js/jscalendar/skins/aqua/active-bg.gif
plog/trunk/js/jscalendar/skins/aqua/dark-bg.gif
plog/trunk/js/jscalendar/skins/aqua/hover-bg.gif
plog/trunk/js/jscalendar/skins/aqua/menuarrow.gif
plog/trunk/js/jscalendar/skins/aqua/normal-bg.gif
plog/trunk/js/jscalendar/skins/aqua/rowhover-bg.gif
plog/trunk/js/jscalendar/skins/aqua/status-bg.gif
plog/trunk/js/jscalendar/skins/aqua/theme.css
plog/trunk/js/jscalendar/skins/aqua/title-bg.gif
plog/trunk/js/jscalendar/skins/aqua/today-bg.gif
plog/trunk/js/tinymce/plugins/insertaudio/
plog/trunk/js/tinymce/plugins/insertaudio/audioinput.html
plog/trunk/js/tinymce/plugins/insertaudio/css/
plog/trunk/js/tinymce/plugins/insertaudio/css/content.css
plog/trunk/js/tinymce/plugins/insertaudio/css/flash.css
plog/trunk/js/tinymce/plugins/insertaudio/editor_plugin.js
plog/trunk/js/tinymce/plugins/insertaudio/functions.js
plog/trunk/js/tinymce/plugins/insertaudio/images/
plog/trunk/js/tinymce/plugins/insertaudio/images/player.png
plog/trunk/js/tinymce/plugins/insertaudio/langs/
plog/trunk/js/tinymce/plugins/insertaudio/langs/en.js
plog/trunk/js/tinymce/plugins/insertaudio/langs/fr.js
plog/trunk/js/tinymce/plugins/insertresource/css/
plog/trunk/js/tinymce/plugins/insertresource/css/content.css
plog/trunk/js/tinymce/plugins/insertresource/images/player.png
plog/trunk/js/tinymce/plugins/insertresource/langs/fr.js
plog/trunk/js/tinymce/plugins/insertvideo/README.txt
plog/trunk/js/tinymce/plugins/insertvideo/images/dailymotion.png
plog/trunk/js/tinymce/plugins/insertvideo/langs/fr.js
plog/trunk/js/tinymce/plugins/more/langs/fr.js
plog/trunk/locale/admin/locale_gl_ES.php
plog/trunk/locale/locale_gl_ES.php
plog/trunk/templates/admin/versions.template
Removed:
plog/trunk/class/data/filter/allowedhtmlfilter.class.php
plog/trunk/class/data/filter/filterbase.class.php
plog/trunk/class/data/filter/htmlentitiesfilter.class.php
plog/trunk/class/data/filter/htmlfilter.class.php
plog/trunk/class/data/filter/xhtmlizefilter.class.php
plog/trunk/class/test/tests/data/filter/filterbase_test.class.php
plog/trunk/class/test/tests/data/filter/htmlfilter_test.class.php
plog/trunk/flash/mp3player/
plog/trunk/flash/mp3player/mp3player.swf
plog/trunk/js/calendar/
plog/trunk/js/jscalendar/ChangeLog
plog/trunk/js/jscalendar/README
plog/trunk/js/jscalendar/calendar-blue.css
plog/trunk/js/jscalendar/calendar-blue2.css
plog/trunk/js/jscalendar/calendar-brown.css
plog/trunk/js/jscalendar/calendar-green.css
plog/trunk/js/jscalendar/calendar-setup.js
plog/trunk/js/jscalendar/calendar-setup_stripped.js
plog/trunk/js/jscalendar/calendar-system.css
plog/trunk/js/jscalendar/calendar-tas.css
plog/trunk/js/jscalendar/calendar-win2k-1.css
plog/trunk/js/jscalendar/calendar-win2k-2.css
plog/trunk/js/jscalendar/calendar-win2k-cold-1.css
plog/trunk/js/jscalendar/calendar-win2k-cold-2.css
plog/trunk/js/jscalendar/calendar.js
plog/trunk/js/jscalendar/calendar.php
plog/trunk/js/jscalendar/calendar_stripped.js
plog/trunk/js/jscalendar/img.gif
plog/trunk/js/jscalendar/lang/
plog/trunk/js/jscalendar/lang/calendar-af.js
plog/trunk/js/jscalendar/lang/calendar-al.js
plog/trunk/js/jscalendar/lang/calendar-bg.js
plog/trunk/js/jscalendar/lang/calendar-big5-utf8.js
plog/trunk/js/jscalendar/lang/calendar-big5.js
plog/trunk/js/jscalendar/lang/calendar-br.js
plog/trunk/js/jscalendar/lang/calendar-ca.js
plog/trunk/js/jscalendar/lang/calendar-cs-utf8.js
plog/trunk/js/jscalendar/lang/calendar-cs-win.js
plog/trunk/js/jscalendar/lang/calendar-da.js
plog/trunk/js/jscalendar/lang/calendar-de.js
plog/trunk/js/jscalendar/lang/calendar-du.js
plog/trunk/js/jscalendar/lang/calendar-el.js
plog/trunk/js/jscalendar/lang/calendar-en.js
plog/trunk/js/jscalendar/lang/calendar-es.js
plog/trunk/js/jscalendar/lang/calendar-fi.js
plog/trunk/js/jscalendar/lang/calendar-fr.js
plog/trunk/js/jscalendar/lang/calendar-he-utf8.js
plog/trunk/js/jscalendar/lang/calendar-hr-utf8.js
plog/trunk/js/jscalendar/lang/calendar-hr.js
plog/trunk/js/jscalendar/lang/calendar-hu.js
plog/trunk/js/jscalendar/lang/calendar-it.js
plog/trunk/js/jscalendar/lang/calendar-jp.js
plog/trunk/js/jscalendar/lang/calendar-ko-utf8.js
plog/trunk/js/jscalendar/lang/calendar-ko.js
plog/trunk/js/jscalendar/lang/calendar-lt-utf8.js
plog/trunk/js/jscalendar/lang/calendar-lt.js
plog/trunk/js/jscalendar/lang/calendar-lv.js
plog/trunk/js/jscalendar/lang/calendar-nl.js
plog/trunk/js/jscalendar/lang/calendar-no.js
plog/trunk/js/jscalendar/lang/calendar-pl-utf8.js
plog/trunk/js/jscalendar/lang/calendar-pl.js
plog/trunk/js/jscalendar/lang/calendar-pt.js
plog/trunk/js/jscalendar/lang/calendar-ro.js
plog/trunk/js/jscalendar/lang/calendar-ru.js
plog/trunk/js/jscalendar/lang/calendar-ru_win_.js
plog/trunk/js/jscalendar/lang/calendar-si.js
plog/trunk/js/jscalendar/lang/calendar-sk.js
plog/trunk/js/jscalendar/lang/calendar-sp.js
plog/trunk/js/jscalendar/lang/calendar-sv.js
plog/trunk/js/jscalendar/lang/calendar-tr.js
plog/trunk/js/jscalendar/lang/calendar-zh-utf8.js
plog/trunk/js/jscalendar/lang/calendar-zh.js
plog/trunk/js/jscalendar/lang/calendar-zh_CN-utf8.js
plog/trunk/js/jscalendar/lang/calendar-zh_TW-utf8.js
plog/trunk/js/jscalendar/lang/cn_utf8.js
plog/trunk/js/jscalendar/menuarrow.gif
plog/trunk/js/jscalendar/menuarrow2.gif
plog/trunk/js/jscalendar/release-notes.html
plog/trunk/js/jscalendar/skins/
plog/trunk/js/jscalendar/skins/aqua/
plog/trunk/js/jscalendar/skins/aqua/active-bg.gif
plog/trunk/js/jscalendar/skins/aqua/dark-bg.gif
plog/trunk/js/jscalendar/skins/aqua/hover-bg.gif
plog/trunk/js/jscalendar/skins/aqua/menuarrow.gif
plog/trunk/js/jscalendar/skins/aqua/normal-bg.gif
plog/trunk/js/jscalendar/skins/aqua/rowhover-bg.gif
plog/trunk/js/jscalendar/skins/aqua/status-bg.gif
plog/trunk/js/jscalendar/skins/aqua/theme.css
plog/trunk/js/jscalendar/skins/aqua/title-bg.gif
plog/trunk/js/jscalendar/skins/aqua/today-bg.gif
plog/trunk/js/tinymce/plugins/insertaudio/audioinput.html
plog/trunk/js/tinymce/plugins/insertaudio/css/
plog/trunk/js/tinymce/plugins/insertaudio/css/content.css
plog/trunk/js/tinymce/plugins/insertaudio/css/flash.css
plog/trunk/js/tinymce/plugins/insertaudio/editor_plugin.js
plog/trunk/js/tinymce/plugins/insertaudio/functions.js
plog/trunk/js/tinymce/plugins/insertaudio/images/
plog/trunk/js/tinymce/plugins/insertaudio/images/player.png
plog/trunk/js/tinymce/plugins/insertaudio/langs/
plog/trunk/js/tinymce/plugins/insertaudio/langs/en.js
plog/trunk/js/tinymce/plugins/insertaudio/langs/fr.js
plog/trunk/js/tinymce/plugins/insertresource/css/content.css
plog/trunk/locale/unported/locale_gl_ES.php
plog/trunk/templates/admin/calendarstuff.template
Modified:
plog/trunk/admin.php
plog/trunk/bin-devel/build-diff.sh
plog/trunk/bin-devel/build-svn.sh
plog/trunk/class/action/addcommentaction.class.php
plog/trunk/class/action/admin/adminaddbloguseraction.class.php
plog/trunk/class/action/admin/adminadminblogselectaction.class.php
plog/trunk/class/action/admin/admincleanupaction.class.php
plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
plog/trunk/class/action/admin/adminupdatepostaction.class.php
plog/trunk/class/action/searchaction.class.php
plog/trunk/class/config/properties.class.php
plog/trunk/class/controller/admincontrollermap.properties.php
plog/trunk/class/dao/articles.class.php
plog/trunk/class/dao/blogsettings.class.php
plog/trunk/class/dao/customfields/customfieldsvalues.class.php
plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
plog/trunk/class/file/file.class.php
plog/trunk/class/gallery/dao/galleryresource.class.php
plog/trunk/class/gallery/dao/galleryresources.class.php
plog/trunk/class/mail/emailservice.class.php
plog/trunk/class/net/request.class.php
plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php
plog/trunk/class/plugin/pluginbase.class.php
plog/trunk/class/plugin/pluginmanager.class.php
plog/trunk/class/summary/action/doblogregistration.class.php
plog/trunk/class/summary/action/dousercreation.class.php
plog/trunk/class/template/cachedtemplate.class.php
plog/trunk/class/template/smarty/plugins/modifier.utf8_wordwrap.php
plog/trunk/class/test/PHPUnit.php
plog/trunk/class/test/PHPUnit/GUI/Gtk.php
plog/trunk/class/test/PHPUnit/RepeatedTest.php
plog/trunk/class/test/PHPUnit/Skeleton.php
plog/trunk/class/test/PHPUnit/TestCase.php
plog/trunk/class/test/PHPUnit/TestDecorator.php
plog/trunk/class/test/PHPUnit/TestResult.php
plog/trunk/class/test/PHPUnit/TestSuite.php
plog/trunk/class/test/tests/data/validator/blognamevalidator_test.class.php
plog/trunk/class/view/admin/adminblogsettingsview.class.php
plog/trunk/class/view/admin/adminview.class.php
plog/trunk/index.php
plog/trunk/install/defaultconfig.properties.php
plog/trunk/js/tinymce/plugins/insertresource/editor_plugin.js
plog/trunk/js/tinymce/plugins/insertvideo/css/content.css
plog/trunk/js/tinymce/plugins/insertvideo/editor_plugin.js
plog/trunk/js/tinymce/plugins/insertvideo/functions.js
plog/trunk/js/tinymce/plugins/insertvideo/langs/en.js
plog/trunk/js/tinymce/plugins/insertvideo/videoinput.html
plog/trunk/js/tinymce/tiny_mce-plog-resourcelist.js
plog/trunk/js/tinymce/tiny_mce-plog.js
plog/trunk/js/ui/common.js
plog/trunk/js/ui/default.js
plog/trunk/locale/admin/locale_ca_ES.php
plog/trunk/locale/admin/locale_de_DE.php
plog/trunk/locale/admin/locale_en_UK.php
plog/trunk/locale/admin/locale_es_ES.php
plog/trunk/locale/admin/locale_fr_FR.php
plog/trunk/locale/admin/locale_it_IT.php
plog/trunk/locale/admin/locale_nl_NL.php
plog/trunk/locale/admin/locale_zh_CN.php
plog/trunk/locale/admin/locale_zh_TW.php
plog/trunk/locale/locale_fr_FR.php
plog/trunk/templates/LifeType/en_UK/strings.txt
plog/trunk/templates/LifeType/footermain.template
plog/trunk/templates/admin/addbloguser.template
plog/trunk/templates/admin/blogsettings.template
plog/trunk/templates/admin/chooser/resourcelist.template
plog/trunk/templates/admin/editpost.template
plog/trunk/templates/admin/globalsettings_security.template
plog/trunk/templates/admin/menus.xml
plog/trunk/templates/admin/newpost.template
plog/trunk/templates/admin/siteblogs.template
plog/trunk/templates/rss/atom.template
plog/trunk/templates/summary/rss/atom.template
plog/trunk/templates/summary/rss/blogs_atom.template
plog/trunk/wizard.php
Log:
Merge from the 1.2 branch to trunk (5368 to 5487)
Modified: plog/trunk/admin.php
===================================================================
--- plog/trunk/admin.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/admin.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -40,7 +40,7 @@
$pluginManager->loadPlugins( "admin" );
// give control to the, ehem, controller :)
- $controller->process( HttpVars::getRequest(), "op");
+ $controller->process( HttpVars::getRequest());
// log statistics, only for debugging purposes
//Info::logMetrics();
Modified: plog/trunk/bin-devel/build-diff.sh
===================================================================
--- plog/trunk/bin-devel/build-diff.sh 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/bin-devel/build-diff.sh 2007-06-05 13:51:03 UTC (rev 5488)
@@ -38,6 +38,9 @@
svn switch $SVNSERVER$SVNREPO/$BRANCH2 > files
cd ..
+echo "Generating MD5 hash of files..."
+php $WORKFOLDER/bin-devel/genmd5.php
+
echo "Copying new or updated files..."
# need to change this. We should parse deleted files, and parse
# this list in order because the same file could have been added
@@ -51,6 +54,11 @@
cp $WORKFOLDER/$i $DESTFOLDER/$FOLDER
done
+# make sure that install/files.properties.php is included
+echo "Moving the updated files.properties.php to the destination package..."
+mkdir -p $DESTFOLDER/install
+cp $WORKFOLDER/install/files.properties.php $DESTFOLDER/install/files.properties.php
+
# remove temporary folders
rm -rf $WORKFOLDER
@@ -62,7 +70,6 @@
rm -r $DESTFOLDER/bin-devel/
rm -r $DESTFOLDER/docs-devel/
rm -r $DESTFOLDER/plog.xcode/
-rm -r $DESTFOLDER/install/
rm -r $DESTFOLDER/release/
rm -r $DESTFOLDER/templates/LifeType
rm -r $DESTFOLDER/templates/grey-sf
Modified: plog/trunk/bin-devel/build-svn.sh
===================================================================
--- plog/trunk/bin-devel/build-svn.sh 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/bin-devel/build-svn.sh 2007-06-05 13:51:03 UTC (rev 5488)
@@ -46,8 +46,8 @@
cleanup_exit()
{
- rm -rf $WORKDIR
- rm -rf $WORKDIR-docs
+ #rm -rf $WORKDIR
+ #rm -rf $WORKDIR-docs
exit $1
}
@@ -115,6 +115,10 @@
cp -f $WORKDIR/release/userdata.properties.php.dist $WORKDIR/config/userdata.properties.php
rm -rf $WORKDIR/dist
+# generate install/file.properties.php with the MD5 hashes of most core files
+message "Generating MD5 hashes..."
+php $WORKDIR/bin-devel/genmd5.php
+
# finally, update the version.php file
message "Updating the version.php file..."
echo "<?php" > $WORKDIR/version.php
Copied: plog/trunk/bin-devel/genmd5.php (from rev 5487, plog/branches/lifetype-1.2/bin-devel/genmd5.php)
===================================================================
--- plog/trunk/bin-devel/genmd5.php (rev 0)
+++ plog/trunk/bin-devel/genmd5.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * This script is called during the build process
+ */
+
+if (!defined( "PLOG_CLASS_PATH" )) {
+ define( "PLOG_CLASS_PATH", dirname(__FILE__)."/../");
+}
+
+include_once( PLOG_CLASS_PATH."class/bootstrap.php" );
+lt_include( PLOG_CLASS_PATH."class/misc/integritychecker.class.php" );
+lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
+
+File::chDir( PLOG_CLASS_PATH );
+IntegrityChecker::writeMD5ListToFile();
+
+?>
\ No newline at end of file
Modified: plog/trunk/class/action/addcommentaction.class.php
===================================================================
--- plog/trunk/class/action/addcommentaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/addcommentaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -10,6 +10,9 @@
lt_include( PLOG_CLASS_PATH."class/data/validator/emailvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/httpurlvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/allowedhtmlfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/xhtmlizefilter.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/errorview.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/redirectview.class.php" );
lt_include( PLOG_CLASS_PATH."class/bayesian/bayesianfiltercore.class.php" );
@@ -40,7 +43,17 @@
function AddCommentAction( $blogInfo, $request )
{
$this->BlogAction( $blogInfo, $request );
-
+
+ // input filters
+ $f = new HtmlFilter();
+ $this->_request->registerFilter( "userEmail", $f );
+ $this->_request->registerFilter( "userUrl", $f );
+ $this->_request->registerFilter( "userName", $f );
+ $this->_request->registerFilter( "commentTopic", $f );
+ $f = new AllowedHtmlFilter();
+ $f->addFilter( new XhtmlizeFilter());
+ $this->_request->registerFilter( "commentText", $f );
+
// change the validation mode of the form
$this->registerFieldValidator( "articleId", new IntegerValidator());
$this->_form->setFieldErrorMessage( "articleId", $this->_locale->tr("error_incorrect_article_id" ));
@@ -67,26 +80,27 @@
{
lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ $f = new HtmlFilter( true );
+
$this->_articleId = $this->_request->getValue( "articleId" );
$this->_blogId = $this->_request->getValue( "blogId" );
$this->_opId = $this->_request->getValue( "op" );
$this->_parentId = $this->_request->getValue( "parentId" );
if( $this->_parentId == null || $this->_parentId == "" )
$this->_parentId = 0;
- $this->_userEmail = Textfilter::filterAllHTML($this->_request->getValue( "userEmail" ));
- $this->_userUrl = Textfilter::filterAllHTML($this->_request->getValue( "userUrl" ));
+ $this->_userEmail = $this->_request->getValue( "userEmail" );
+ $this->_userUrl = $this->_request->getValue( "userUrl" );
if( (strlen($this->_userUrl) != 0) &&
ereg('^https{0,1}://',$this->_userUrl) == false){
$this->_userUrl = "http://".$this->_userUrl;
}
- $this->_userName = Textfilter::filterAllHTML($this->_request->getValue( "userName" ));
+ $this->_userName = $this->_request->getValue( "userName" );
$this->_commentText = trim($this->_request->getValue( "commentText" ));
- $this->_commentTopic = Textfilter::filterAllHTML($this->_request->getValue( "commentTopic" ));
- // remove all weird stuff from the comment text
- $tf = new TextFilter();
- $this->_commentText = $tf->xhtmlize($tf->filterHTML( $this->_commentText ));
+ $this->_commentTopic = $this->_request->getValue( "commentTopic" );
+
// now, if the option is set, we 'beautify' the text typed by users
if( $this->_config->getValue( "beautify_comments_text" )) {
+ $tf = new TextFilter();
$this->_commentText = $tf->autop($this->_commentText);
}
}
Modified: plog/trunk/class/action/admin/adminaddbloguseraction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddbloguseraction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/adminaddbloguseraction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -28,11 +28,15 @@
// data validation
$this->registerFieldValidator( "newBlogUserName", new StringValidator());
+
$this->_sendNotification = ($this->_request->getValue( "sendNotification" ) != "" );
- if( $this->_sendNotification )
+
+ if( $this->_sendNotification ) {
$this->registerFieldValidator( "newBlogUserText", new StringValidator());
- else
+ }
+ else {
$this->registerField( "newBlogUserText" );
+ }
$this->registerField( "sendNotification" );
$this->registerField( "perm" );
@@ -43,7 +47,7 @@
$this->requirePermission( "add_blog_user" );
}
- function sendNotificationEmail( $userInfo )
+ function sendNotificationEmail( &$userInfo )
{
// if everything went fine, we can now send the confirmation email
// only if the user specified a valid email address
@@ -51,7 +55,7 @@
// build an email message
$message = new EmailMessage();
$message->setBody( $this->_notificationText );
- $message->setSubject( "LifeType Notification" );
+ $message->setSubject( $this->_locale->tr("notification_subject") );
$message->addTo( $userInfo->getEmail());
$message->setFrom( $this->_userInfo->getEmail());
// and finally send it
@@ -106,14 +110,18 @@
$this->sendNotificationEmail( $userInfo );
}
- if( $this->userHasPermission( "view_blog_users" ))
+ if( $this->userHasPermission( "view_blog_users" )) {
$this->_view = new AdminBlogUsersListView( $this->_blogInfo );
- else
+ }
+ else {
$this->_view = new AdminNewBlogUserView( $this->_blogInfo );
+ }
+
$this->_view->setSuccessMessage( $this->_locale->pr("user_added_to_blog_ok", $userInfo->getUsername()));
$this->setCommonData();
return true;
}
+
}
-?>
\ No newline at end of file
+?>
Modified: plog/trunk/class/action/admin/adminadminblogselectaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminadminblogselectaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/adminadminblogselectaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -40,7 +40,7 @@
$this->_blogId = $this->_request->getValue( "blogId" );
// load the blog
- require_once( PLOG_CLASS_PATH . "class/dao/blogs.class.php" );
+ lt_include( PLOG_CLASS_PATH . "class/dao/blogs.class.php" );
$blogs = new Blogs();
$blogInfo = $blogs->getBlogInfo( $this->_blogId );
Modified: plog/trunk/class/action/admin/admincleanupaction.class.php
===================================================================
--- plog/trunk/class/action/admin/admincleanupaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/admincleanupaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -177,14 +177,15 @@
$blogs = new Blogs();
$activeBlogs = $blogs->getAllBlogs( BLOG_STATUS_ACTIVE );
- // Get the plugin manager
- $plugMgr =& PluginManager::getPluginManager();
+ // Get the plugin manager
+// $plugMgr =& PluginManager::getPluginManager();
foreach( $activeBlogs as $blogInfo ) {
- $plugMgr->setBlogInfo( $blogInfo);
- $plugMgr->loadPlugins( "admin" );
+ $this->_pm->setBlogInfo( $blogInfo);
+ $this->_pm->loadPlugins( "admin" );
+ $this->_pm->getPlugins();
// Send the EVENT_POST_ADMIN_PURGE_TEMP_FOLDER message
- $plugMgr->notifyEvent( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
+ $this->_pm->notifyEvent( EVENT_POST_ADMIN_PURGE_TEMP_FOLDER );
}
$this->_message = $this->_locale->tr( "temp_folder_reset_ok" );
Modified: plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -127,8 +127,13 @@
$this->_postText = stripslashes($this->_request->getValue( "postText" ));
else
$this->_postText = $this->_request->getValue( "postText" );
-
- $this->_postText = trim(Textfilter::xhtmlize(Textfilter::filterJavaScript($this->_postText)));
+
+ // check if javascript code is allowed in posts
+ $config =& Config::getConfig();
+ if( !$config->getValue( "allow_javascript_blocks_in_posts", false )) {
+ $this->_postText = Textfilter::filterJavaScript( $this->_postText );
+ }
+ $this->_postText = trim(Textfilter::xhtmlize( $this->_postText ));
$this->_postTopic = trim(Textfilter::xhtmlize(Textfilter::filterAllHTML($this->_request->getValue( "postTopic" ))));
$this->_posterId = $this->_request->getValue( "posterId" );
$this->_postCategories = $this->_request->getValue( "postCategories" );
Modified: plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/adminupdateblogsettingsaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -39,6 +39,7 @@
$this->registerFieldValidator( "blogTemplate", new StringValidator());
$this->registerFieldValidator( "blogCategory", new IntegerValidator());
$this->registerFieldValidator( "blogNumCommentsPerPage", $val );
+ $this->registerFieldValidator( "blogArticlesOrder", new IntegerValidator());
$this->registerField( "blogAbout" );
$this->registerField( "blogShowMoreEnabled" );
$this->registerField( "blogEnableHtmlarea" );
@@ -130,6 +131,7 @@
$blogSettings->setValue( "show_comments_max", $this->_request->getValue( "blogNumCommentsPerPage" ));
//$blogSettings->setValue( "comment_only_auth_users", Textfilter::checkboxToBoolean($this->_request->getValue( "blogCommentOnlyRegisteredUsers" )));
$blogSettings->setValue( "comments_order", $this->_request->getValue( "blogCommentsOrder" ));
+ $blogSettings->setValue( "articles_order", $this->_request->getValue( "blogArticlesOrder" ));
$blogSettings->setValue( "default_send_notification", $this->_request->getValue( "blogSendNotification" ));
$this->_blogInfo->setAbout( Textfilter::filterAllHTML($this->_request->getValue( "blogAbout" )));
$this->_blogInfo->setBlog( Textfilter::filterAllHTML($this->_request->getValue( "blogName" )));
Modified: plog/trunk/class/action/admin/adminupdatepostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdatepostaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/admin/adminupdatepostaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -117,7 +117,12 @@
$post->setCommentsEnabled( $this->_commentsEnabled );
$post->setPostSlug( $this->_postSlug );
$post->setGlobalCategoryId( $this->_globalArticleCategoryId );
- $post->setUser( $this->_posterId );
+ $post->setUser( $this->_posterId );
+
+ // set the modification date
+ $blogSettings = $this->_blogInfo->getSettings();
+ $modifDate = Timestamp::getDateWithOffset( new Timestamp(), $blogSettings->getValue( "time_offset", 0 ));
+ $post->setModificationDate( $modifDate );
// prepare the custom fields
$fields = Array();
@@ -175,42 +180,56 @@
}
}
- // if the "send xmlrpc pings" checkbox was enabled, do something about it...
+ // only send trackbacks and xmlrpc pings
+ // when a post is "published"
if( $post->getStatus() == POST_STATUS_PUBLISHED ) {
// get the links from the text of the post
- $postLinks = StringUtils::getLinks( stripslashes($post->getText()));
+ $postLinks = StringUtils::getLinks(
+ stripslashes($post->getText()));
// get the real trackback links from trackbackUrls
$trackbackLinks = Array();
foreach(explode( "\r\n", $this->_trackbackUrls ) as $host ) {
trim($host);
- if( $host != "" && $host != "\r\n" && $host != "\r" && $host != "\n" )
+ if( $host != "" && $host != "\r\n" &&
+ $host != "\r" && $host != "\n" )
+ {
array_push( $trackbackLinks, $host );
+ }
}
- if( $this->_sendPings ) {
+ // if the "send xmlrpc pings" checkbox was enabled,
+ // do something about it...
+ if( $this->_sendPings ) {
$t = new Timestamp();
$today = $t->getTimestamp();
if($today > $post->getDate()){
$message .= "<br/><br/>".$this->sendXmlRpcPings();
}
}
- // and now check what to do with the trackbacks
- if( $this->_sendTrackbacks ) {
- // if no links, there is nothing to do
- if( count($postLinks) == 0 && count($trackbackLinks) == 0 ) {
- $this->_view = new AdminPostsListView( $this->_blogInfo );
- $this->_view->setErrorMessage( $this->_locale->tr("error_no_trackback_links_sent"));
- }
- else {
- $this->_view = new AdminTemplatedView( $this->_blogInfo, "sendtrackbacks" );
- // get the links from the text of the post
- $this->_view->setValue( "post", $post );
- $this->_view->setValue( "postLinks", $postLinks );
- $this->_view->setValue( "trackbackLinks", $trackbackLinks );
- }
- }
- }
+ // and now check what to do with the trackbacks
+ if( $this->_sendTrackbacks ) {
+ // if no links, there is nothing to do
+ if( count($postLinks) == 0 &&
+ count($trackbackLinks) == 0 )
+ {
+ $this->_view = new AdminPostsListView(
+ $this->_blogInfo );
+ $this->_view->setErrorMessage(
+ $this->_locale->tr(
+ "error_no_trackback_links_sent"));
+ }
+ else {
+ $this->_view = new AdminTemplatedView(
+ $this->_blogInfo, "sendtrackbacks" );
+ // get the links from the text of the post
+ $this->_view->setValue( "post", $post );
+ $this->_view->setValue( "postLinks", $postLinks );
+ $this->_view->setValue( "trackbackLinks",
+ $trackbackLinks );
+ }
+ }
+ }
// show the message
$this->_view->setSuccessMessage( $message );
Copied: plog/trunk/class/action/admin/adminversioncheckaction.class.php (from rev 5487, plog/branches/lifetype-1.2/class/action/admin/adminversioncheckaction.class.php)
===================================================================
--- plog/trunk/class/action/admin/adminversioncheckaction.class.php (rev 0)
+++ plog/trunk/class/action/admin/adminversioncheckaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,60 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/misc/integritychecker.class.php" );
+
+ /**
+ * \ingroup Action
+ * @private
+ *
+ * Checks that all files have got the right version
+ */
+ class AdminVersionCheckAction extends AdminAction
+ {
+ function AdminVersionCheckAction( $actionInfo, $request )
+ {
+ $this->AdminAction( $actionInfo, $request );
+
+ $this->requireAdminPermission( "view_global_settings" );
+ }
+
+ function perform()
+ {
+ $result = false;
+
+ $this->_view = new AdminTemplatedView( $this->_blogInfo, "versions" );
+
+ // decide what we're going to do...
+ $this->_op = $this->_request->getValue( "op" );
+ if( $this->_op == "doFileVersionCheck" ) {
+ // here we have to check the files and display the result
+
+ // load the file with the reference checksums, as generated by the development
+ // team prior to the release
+ include( PLOG_CLASS_PATH."install/files.properties.php");
+
+ // now check the reference data agains the current data. The default folders are
+ // "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default"
+ $result = IntegrityChecker::checkIntegrity(
+ $data
+ );
+
+ if( empty( $result ))
+ $this->_view->setSuccessMessage( $this->_locale->tr( "all_files_ok" ));
+ else {
+ $fileList = implode( "<br/>", array_keys( $result ));
+ $message = $this->_locale->tr( "incorrect_file_version_error" )."<br/>".$fileList;
+ $this->_view->setErrorMessage( $message );
+ }
+ }
+
+ lt_include( PLOG_CLASS_PATH."class/misc/version.class.php" );
+ $this->_view->setValue( "version", Version::getVersion());
+
+ $this->setCommonData();
+
+ return true;
+ }
+ }
+?>
\ No newline at end of file
Modified: plog/trunk/class/action/searchaction.class.php
===================================================================
--- plog/trunk/class/action/searchaction.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/action/searchaction.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -7,7 +7,7 @@
lt_include( PLOG_CLASS_PATH."class/dao/searchengine.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/blogtemplatedview.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
lt_include( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/errorview.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );
@@ -30,8 +30,7 @@
function perform()
{
// get the search terms that have already been validated...
- $tf = new Textfilter();
- $this->_searchTerms = $tf->filterAllHTML( $this->_request->getValue( "searchTerms" ));
+ $this->_searchTerms = $this->_request->getFilteredValue( "searchTerms", new HtmlFilter());
// check if the search feature is disabled in this site...
$config =& Config::getConfig();
Modified: plog/trunk/class/config/properties.class.php
===================================================================
--- plog/trunk/class/config/properties.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/config/properties.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -11,6 +11,8 @@
{
var $_props;
+
+ var $_keyFilters;
/**
* Constructor.
@@ -20,8 +22,8 @@
*/
function Properties( $values = null )
{
+ $this->_keyFilters = Array();
-
if( $values == null )
$this->_props = Array();
else
@@ -45,16 +47,62 @@
* @param key Key whose value we want to fetch
* @param defaultValue value that we should return in case the one we're looking for
* is empty or does not exist
+ * @param filterClass An instance of an object implementing the FilterBase interface that
+ * will be used to process the value before returning it.
* @return Value associated to that key
*/
- function getValue( $key, $defaultValue = null )
+ function getValue( $key, $defaultValue = null, $filterClass = null )
{
if( !isset($this->_props[$key]) ) {
- return $defaultValue;
+ $value = $defaultValue;
} else {
- return $this->_props[$key];
+ $value = $this->_props[$key];
}
+
+ if( $filterClass || isset( $this->_keyFilters[$key] )) {
+ // there's a filter class specified, so we should run the
+ // resulting value through it...
+ if( isset( $this->_keyFilters[$key] )) {
+ $filterClass = $this->_keyFilters[$key];
+ //print("using filter: ".get_class($filterClass)." - key = ".$key."<br/>" );
+ }
+
+ $value = $filterClass->filter( $value );
+ }
+
+ return( $value );
}
+
+ /**
+ * This method is an alias for Properties::getValue() but the filter
+ * class is now a mandatory parameter
+ *
+ * @param key Key whose value we want to fetch
+ * @param filterClass An instance of an object implementing the FilterBase interface that
+ * will be used to process the value before returning it.
+ * @param defaultValue value that we should return in case the one we're looking for
+ * is empty or does not exist
+ * @return Value associated to that key
+ * @see Properties::getValue()
+ */
+ function getFilteredValue( $key, $filterClass, $defaultValue = null )
+ {
+ return( $this->getValue( $key, $defaultValue, $filterClass ));
+ }
+
+ /**
+ * Registers a filter class for the key "$key", so that
+ * every time Properties::getValue( "$key" ) is called to fetch the requested
+ * value, the filter will be applied automatically without the need to specify
+ * the filter class at every call
+ *
+ * @param key
+ * @param filterClass
+ */
+ function registerFilter( $key, &$filterClass )
+ {
+ $this->_keyFilters[$key] = $filterClass;
+ }
/**
* Method overwritten from the Object class
Modified: plog/trunk/class/controller/admincontrollermap.properties.php
===================================================================
--- plog/trunk/class/controller/admincontrollermap.properties.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/controller/admincontrollermap.properties.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -321,7 +321,10 @@
// bulk update of blogs
$actions["changeBlogStatus"] = "AdminChangeBlogStatusAction";
// bulk update of users
- $actions["changeUserStatus"] = "AdminChangeUserStatusAction";
+ $actions["changeUserStatus"] = "AdminChangeUserStatusAction";
+ // perform an md5 check of some core files
+ $actions["Versions"] = "AdminVersionCheckAction";
+ $actions["doFileVersionCheck"] = "AdminVersionCheckAction";
// location
$actions['locationChooser'] = 'AdminLocationChooserAction';
$actions['adminLocationDisplay'] = 'AdminLocationDisplayAction';
Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/dao/articles.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -454,6 +454,7 @@
a.num_nonspam_trackbacks AS num_nonspam_trackbacks,
a.global_category_id AS global_category_id,
a.in_summary_page AS in_summary_page,
+ a.modification_date AS modification_date,
a.loc_id AS loc_id
FROM {$prefix}articles a, {$prefix}articles_categories c,
{$prefix}article_categories_link l";
@@ -470,7 +471,17 @@
$query .= " ORDER BY relevance";
}
else {
- $query .= " ORDER BY a.date DESC";
+ // check article order preference, default to newest first
+ lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
+ $blogs = new Blogs();
+ $blogInfo = $blogs->getBlogInfo( $blogId );
+ $blogSettings = $blogInfo->getSettings();
+
+ if($blogSettings->getValue( "articles_order" ) == 1) {
+ $query .= " ORDER BY a.date ASC";
+ } else {
+ $query .= " ORDER BY a.date DESC";
+ }
}
// we don't need limits if we're getting the posts for a given day
@@ -1194,9 +1205,10 @@
$timeDiff = $blogSettings->getValue( 'time_offset' );
else
$timeDiff = 0;
-
+
// we can use this auxiliary function to help us...
$date = Timestamp::getDateWithOffset( $query_result['date'], $timeDiff );
+ $modifDate = Timestamp::getDateWithOffset( $query_result['modification_date'], $timeDiff );
$categories = new ArticleCategories();
$articleCategories = $categories->getArticleCategories( $query_result['id'], $query_result['blog_id'] );
@@ -1220,6 +1232,7 @@
// and fill in all the fields with the information we just got from the db
$article->setDate( $date );
+ $article->setModificationDate( $modifDate );
$article->setTimeOffset( $timeDiff );
$article->setCategories( $articleCategories );
// get information about the categories of the article
@@ -1247,4 +1260,4 @@
}
}
-?>
\ No newline at end of file
+?>
Modified: plog/trunk/class/dao/blogsettings.class.php
===================================================================
--- plog/trunk/class/dao/blogsettings.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/dao/blogsettings.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -47,7 +47,7 @@
$this->setValue( "time_offset", $config->getValue( "default_time_offset", DEFAULT_TIME_OFFSET ));
}
- function getValue( $key, $defaultValue = null )
+ function getValue( $key, $defaultValue = null, $filterClass = null )
{
// is it a plugin key?
if( substr( $key, 0, strlen( "plugin_" )) == "plugin_" ) {
@@ -57,7 +57,7 @@
if( GlobalPluginConfig::canOverride( $key ) == PLUGIN_SETTINGS_USER_CAN_OVERRIDE ) {
// load the value from our settings, but if it isn't available, then return whatever the global
// plugin settings say
- $value = parent::getValue( $key, GlobalPluginConfig::getValue( $key ));
+ $value = parent::getValue( $key, GlobalPluginConfig::getValue( $key ), $filterClass );
}
else {
$value = GlobalPluginConfig::getValue( $key );
Modified: plog/trunk/class/dao/customfields/customfieldsvalues.class.php
===================================================================
--- plog/trunk/class/dao/customfields/customfieldsvalues.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/dao/customfields/customfieldsvalues.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -45,7 +45,8 @@
v.article_id AS article_id, v.blog_id AS blog_id
FROM {$prefix}custom_fields_values v
RIGHT OUTER JOIN {$prefix}custom_fields_definition d
- ON v.article_id = ".Db::qstr($articleId)." AND v.field_id = d.id";
+ ON v.field_id = d.id
+ WHERE v.article_id = '".Db::qstr($articleId)."'";
$result = $this->Execute( $query );
Modified: plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php
===================================================================
--- plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/dao/userdata/lifetypeuserdataprovider.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -53,7 +53,7 @@
function getUserInfo( $user, $pass )
{
$userInfo = $this->getUserInfoFromUsername( $user );
- if ( $userInfo->getPassword() == md5($pass) ) {
+ if ( $userInfo && ($userInfo->getPassword() == md5($pass)) ) {
return $userInfo;
} else {
return false;
Copied: plog/trunk/class/data/filter (from rev 5487, plog/branches/lifetype-1.2/class/data/filter)
Deleted: plog/trunk/class/data/filter/allowedhtmlfilter.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/filter/allowedhtmlfilter.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/data/filter/allowedhtmlfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -1,26 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
-
- /**
- * \ingroup Filter
- *
- * This class extends the FilterBase interface to filter all HTML
- * code in the given string except the allowed tags
- */
- class AllowedHtmlFilter extends FilterBase
- {
- /**
- * Filters out all HTML code except the allowed tags
- *
- * @param data
- * @return The input string without HTML code
- */
- function filter( $data )
- {
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
- $tf = new Textfilter();
- return( parent::filter( $tf->filterHTML( $data )));
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/filter/allowedhtmlfilter.class.php (from rev 5487, plog/branches/lifetype-1.2/class/data/filter/allowedhtmlfilter.class.php)
===================================================================
--- plog/trunk/class/data/filter/allowedhtmlfilter.class.php (rev 0)
+++ plog/trunk/class/data/filter/allowedhtmlfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,26 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
+
+ /**
+ * \ingroup Filter
+ *
+ * This class extends the FilterBase interface to filter all HTML
+ * code in the given string except the allowed tags
+ */
+ class AllowedHtmlFilter extends FilterBase
+ {
+ /**
+ * Filters out all HTML code except the allowed tags
+ *
+ * @param data
+ * @return The input string without HTML code
+ */
+ function filter( $data )
+ {
+ lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ $tf = new Textfilter();
+ return( parent::filter( $tf->filterHTML( $data )));
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/data/filter/filterbase.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/filter/filterbase.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/data/filter/filterbase.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -1,66 +0,0 @@
-<?php
-
- /**
- * \defgroup Filter
- *
- * Filters in Lifetype can be used to perform filtering operations on data, although
- * they will be used most of the times as input filters to filter the values of
- * incoming parameters.
- *
- * @see Properties::getValue()
- */
-
- /**
- * \ingroup Filter
- *
- * This class is the base class that defines the interface for
- * filter classes. You should probably not be instantiating objects of this class
- * but instead, extend it and implement the FilterBase::filter() method.
- *
- * It is also possible to chain multiple validators, in a way that the output of
- * the previous one becomes the input of the next one. Please see the
- * FilterBase::addFilter() method
- */
- class FilterBase
- {
- var $_filters;
-
- /**
- * Constructor of the class
- */
- function FilterBase()
- {
- $this->_filters = Array();
- }
-
- /**
- * Appends a validator to the current one. Validators appended to this one
- * are chained <b>at the end</b> so they always get executed
- * <b>after</b> this one is.
- *
- * @param filterInstance An instance of a class that implements the FilterBase interface
- * @return Always true
- */
- function addFilter( &$filterInstance )
- {
- $this->_filters[] = $filterInstance;
-
- return( true );
- }
-
- /**
- * This is the main method that takes care of the processing of the input data
- *
- * @param data Unfiltered data
- * @return The filtered data
- */
- function filter( $data )
- {
- foreach( $this->_filters as $filterClass ) {
- $data = $filterClass->filter( $data );
- }
-
- return( $data );
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/filter/filterbase.class.php (from rev 5487, plog/branches/lifetype-1.2/class/data/filter/filterbase.class.php)
===================================================================
--- plog/trunk/class/data/filter/filterbase.class.php (rev 0)
+++ plog/trunk/class/data/filter/filterbase.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,66 @@
+<?php
+
+ /**
+ * \defgroup Filter
+ *
+ * Filters in Lifetype can be used to perform filtering operations on data, although
+ * they will be used most of the times as input filters to filter the values of
+ * incoming parameters.
+ *
+ * @see Properties::getValue()
+ */
+
+ /**
+ * \ingroup Filter
+ *
+ * This class is the base class that defines the interface for
+ * filter classes. You should probably not be instantiating objects of this class
+ * but instead, extend it and implement the FilterBase::filter() method.
+ *
+ * It is also possible to chain multiple validators, in a way that the output of
+ * the previous one becomes the input of the next one. Please see the
+ * FilterBase::addFilter() method
+ */
+ class FilterBase
+ {
+ var $_filters;
+
+ /**
+ * Constructor of the class
+ */
+ function FilterBase()
+ {
+ $this->_filters = Array();
+ }
+
+ /**
+ * Appends a validator to the current one. Validators appended to this one
+ * are chained <b>at the end</b> so they always get executed
+ * <b>after</b> this one is.
+ *
+ * @param filterInstance An instance of a class that implements the FilterBase interface
+ * @return Always true
+ */
+ function addFilter( &$filterInstance )
+ {
+ $this->_filters[] = $filterInstance;
+
+ return( true );
+ }
+
+ /**
+ * This is the main method that takes care of the processing of the input data
+ *
+ * @param data Unfiltered data
+ * @return The filtered data
+ */
+ function filter( $data )
+ {
+ foreach( $this->_filters as $filterClass ) {
+ $data = $filterClass->filter( $data );
+ }
+
+ return( $data );
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/data/filter/htmlentitiesfilter.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/filter/htmlentitiesfilter.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/data/filter/htmlentitiesfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -1,25 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
-
- /**
- * \ingroup Filter
- *
- * This class extends the FilterBase interface to filter all HTML
- * code in the given string
- */
- class HtmlEntitiesFilter extends FilterBase
- {
- /**
- * Filters out all HTML and Javascript code from the given string
- *
- * @param data
- * @return The input string without HTML code
- */
- function filter( $data )
- {
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
- return( parent::filter( Textfilter::filterHTMLEntities( $data )));
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/filter/htmlentitiesfilter.class.php (from rev 5487, plog/branches/lifetype-1.2/class/data/filter/htmlentitiesfilter.class.php)
===================================================================
--- plog/trunk/class/data/filter/htmlentitiesfilter.class.php (rev 0)
+++ plog/trunk/class/data/filter/htmlentitiesfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,25 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
+
+ /**
+ * \ingroup Filter
+ *
+ * This class extends the FilterBase interface to filter all HTML
+ * code in the given string
+ */
+ class HtmlEntitiesFilter extends FilterBase
+ {
+ /**
+ * Filters out all HTML and Javascript code from the given string
+ *
+ * @param data
+ * @return The input string without HTML code
+ */
+ function filter( $data )
+ {
+ lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ return( parent::filter( Textfilter::filterHTMLEntities( $data )));
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/data/filter/htmlfilter.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/filter/htmlfilter.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/data/filter/htmlfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -1,42 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
-
- /**
- * \ingroup Filter
- *
- * This class extends the FilterBase interface to filter all HTML
- * code in the given string
- */
- class HtmlFilter extends FilterBase
- {
- /**
- * Constructor
- *
- * @param filterEntities When set to true, characters with an available
- * HTML entity will be converted after the string has been cleaned up by
- * the HTML filter. Disabled by default.
- */
- function HtmlFilter( $filterEntities = false )
- {
- $this->FilterBase();
-
- if( $filterEntities ) {
- lt_include( PLOG_CLASS_PATH."class/data/filter/htmlentitiesfilter.class.php" );
- $this->addFilter( new HtmlEntitiesFilter());
- }
- }
-
- /**
- * Filters out all HTML and Javascript code from the given string
- *
- * @param data
- * @return The input string without HTML code
- */
- function filter( $data )
- {
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
- return( parent::filter( Textfilter::filterAllHTML( $data )));
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/filter/htmlfilter.class.php (from rev 5487, plog/branches/lifetype-1.2/class/data/filter/htmlfilter.class.php)
===================================================================
--- plog/trunk/class/data/filter/htmlfilter.class.php (rev 0)
+++ plog/trunk/class/data/filter/htmlfilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,42 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
+
+ /**
+ * \ingroup Filter
+ *
+ * This class extends the FilterBase interface to filter all HTML
+ * code in the given string
+ */
+ class HtmlFilter extends FilterBase
+ {
+ /**
+ * Constructor
+ *
+ * @param filterEntities When set to true, characters with an available
+ * HTML entity will be converted after the string has been cleaned up by
+ * the HTML filter. Disabled by default.
+ */
+ function HtmlFilter( $filterEntities = false )
+ {
+ $this->FilterBase();
+
+ if( $filterEntities ) {
+ lt_include( PLOG_CLASS_PATH."class/data/filter/htmlentitiesfilter.class.php" );
+ $this->addFilter( new HtmlEntitiesFilter());
+ }
+ }
+
+ /**
+ * Filters out all HTML and Javascript code from the given string
+ *
+ * @param data
+ * @return The input string without HTML code
+ */
+ function filter( $data )
+ {
+ lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ return( parent::filter( Textfilter::filterAllHTML( $data )));
+ }
+ }
+?>
\ No newline at end of file
Deleted: plog/trunk/class/data/filter/xhtmlizefilter.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/filter/xhtmlizefilter.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/data/filter/xhtmlizefilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -1,26 +0,0 @@
-<?php
-
- lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
-
- /**
- * \ingroup Filter
- *
- * This class extends the FilterBase interface to try to "fix"
- * and upconvert HTML strings to XHTML
- */
- class XhtmlizeFilter extends FilterBase
- {
- /**
- * Filters out all HTML code except the allowed tags
- *
- * @param data
- * @return The input string converted to XHTML
- */
- function filter( $data )
- {
- lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
- $t = new Textfilter();
- return( parent::filter( $t->xhtmlize( $data )));
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/filter/xhtmlizefilter.class.php (from rev 5487, plog/branches/lifetype-1.2/class/data/filter/xhtmlizefilter.class.php)
===================================================================
--- plog/trunk/class/data/filter/xhtmlizefilter.class.php (rev 0)
+++ plog/trunk/class/data/filter/xhtmlizefilter.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,26 @@
+<?php
+
+ lt_include( PLOG_CLASS_PATH."class/data/filter/filterbase.class.php" );
+
+ /**
+ * \ingroup Filter
+ *
+ * This class extends the FilterBase interface to try to "fix"
+ * and upconvert HTML strings to XHTML
+ */
+ class XhtmlizeFilter extends FilterBase
+ {
+ /**
+ * Filters out all HTML code except the allowed tags
+ *
+ * @param data
+ * @return The input string converted to XHTML
+ */
+ function filter( $data )
+ {
+ lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );
+ $t = new Textfilter();
+ return( parent::filter( $t->xhtmlize( $data )));
+ }
+ }
+?>
\ No newline at end of file
Modified: plog/trunk/class/file/file.class.php
===================================================================
--- plog/trunk/class/file/file.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/file/file.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -325,7 +325,16 @@
return true;
}
-
+
+ /**
+ * Change the current directory
+ *
+ * @param dir
+ */
+ function chDir( $dir )
+ {
+ return( chdir( $dir ));
+ }
/**
* returns a temporary filename in a pseudo-random manner
Modified: plog/trunk/class/gallery/dao/galleryresource.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresource.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/gallery/dao/galleryresource.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -399,15 +399,18 @@
if( $this->getThumbnailFormat() == THUMBNAIL_OUTPUT_FORMAT_SAME_AS_IMAGE )
$previewFile = $fileName;
else
- $previewFile = str_replace( ".".$this->_getFileExtension(), ".".$this->getThumbnailFormat(), $fileName );
+ $previewFile = str_replace( ".".$this->getFileExtension(), ".".$this->getThumbnailFormat(), $fileName );
return $previewFile;
}
/**
- * @private
+ * Returns the file extension
+ *
+ * @param toLower Whether the extension should be returned in lower case, false by default
+ * @return The file extension
*/
- function _getFileExtension()
+ function getFileExtension( $toLower = false )
{
$fileName = $this->getFileName();
if(( $extPos = strrpos( $fileName, "." )) !== false ) {
@@ -441,7 +444,7 @@
if( $this->getThumbnailFormat() == THUMBNAIL_OUTPUT_FORMAT_SAME_AS_IMAGE )
$previewFile = $fileName;
else
- $previewFile = str_replace( ".".$this->_getFileExtension(), ".".$this->getThumbnailFormat(), $fileName );
+ $previewFile = str_replace( ".".$this->getFileExtension(), ".".$this->getThumbnailFormat(), $fileName );
return $previewFile;
}
Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresources.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/gallery/dao/galleryresources.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -59,6 +59,7 @@
"divx" => GALLERY_RESOURCE_VIDEO,
"rm" => GALLERY_RESOURCE_VIDEO,
"swf" => GALLERY_RESOURCE_VIDEO,
+ "flv" => GALLERY_RESOURCE_VIDEO,
"qt" => GALLERY_RESOURCE_VIDEO,
"pdf" => GALLERY_RESOURCE_DOCUMENT,
"zip" => GALLERY_RESOURCE_ZIP
@@ -437,6 +438,7 @@
lt_include( PLOG_CLASS_PATH."class/gallery/getid3/getid3.php" );
$getId3 = new GetID3();
$metadata = $getId3->analyze( $upload->getTmpName());
+
// nifty helper method from the getid3 package
getid3_lib::CopyTagsToComments($metadata);
Modified: plog/trunk/class/mail/emailservice.class.php
===================================================================
--- plog/trunk/class/mail/emailservice.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/mail/emailservice.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -95,6 +95,9 @@
// create a phpmailer object
$mail = new PHPMailer();
+ // need to set PluginDir if we use lt_include()
+ $mail->PluginDir = PLOG_CLASS_PATH."class/mail/phpmailer/";
+
// set a few fields
$mail->ContentType = $message->getMimeType();
$mail->From = $message->getFrom();
Copied: plog/trunk/class/misc/integritychecker.class.php (from rev 5487, plog/branches/lifetype-1.2/class/misc/integritychecker.class.php)
===================================================================
--- plog/trunk/class/misc/integritychecker.class.php (rev 0)
+++ plog/trunk/class/misc/integritychecker.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -0,0 +1,159 @@
+<?php
+
+ /**
+ * \ingroup Misc
+ *
+ * This class is a bunch of helper methods that will calculate the MD5 of the files within
+ * the given list of folders, generate and write a PHP array to disk and compare a reference
+ * array with pre-calculated MD5 hashes of files against the current MD5 hashes of those files
+ * in disk.
+ *
+ * This is not a general purpose class so if you're confused about its description
+ * it probably is not what you're looking for.
+ */
+ class IntegrityChecker
+ {
+
+ /**
+ * Given an array with folder paths, generate another associative array where the key is the path and file
+ * name and the value is the MD5 hash of the contents of the file.
+ *
+ * @param directories Array containing the paths of the directories that should be checked. If no parameter is specified
+ * it defaults to "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default",
+ * all of them under the PLOG_CLASS_PATH base folder
+ * @param recursive Whether to recursively process the given folders
+ * @param includeDirs Determines whether the folder names and paths should be included in the output array, defaults to 'false'
+ * @param ignore Array containing file patterns that will be ignored and not included in the output array
+ * @return An associative array
+ */
+ function generateMD5Folder( $directories = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" ), $recursive = true, $includeDirs = false, $ignore = Array( "*.svn", ".DS_Store" ))
+ {
+ $result = Array();
+ foreach( $directories as $directory ) {
+ $result = array_merge( $result, IntegrityChecker::directoryToMD5Array( $directory, $recursive, $includeDirs, $ignore ));
+ }
+
+ return( $result );
+ }
+
+ /**
+ * Generates an MD5 array, optinally recursively, of the given single folder.
+ *
+ * @param directory
+ * @param recursive
+ * @param includeDirs
+ * @param ignore
+ * @return An associative array
+ * @see IntegrityChecker::generateMD5Folder()
+ */
+ function directoryToMD5Array( $directory, $recursive = true, $includeDirs = false, $ignore = Array( "*.svn" ))
+ {
+ $array_items = array();
+ if ($handle = opendir($directory)) {
+ while (false !== ($file = readdir($handle))) {
+ if ($file != "." && $file != ".." && !IntegrityChecker::canIgnore( $file, $ignore )) {
+ if (is_dir($directory. "/" . $file)) {
+ if($recursive) {
+ $array_items = array_merge($array_items, IntegrityChecker::directoryToMD5Array($directory. "/" . $file, $recursive, $includeDirs, $ignore ));
+ }
+ if( $includeDirs ) {
+ $file = $directory . "/" . $file;
+ $array_items[preg_replace("/\/\//si", "/", $file)] = 0;
+ }
+ }
+ else {
+ $file = $directory . "/" . $file;
+ $array_items[preg_replace("/\/\//si", "/", $file)] = md5(file_get_contents(preg_replace("/\/\//si", "/", $file)));
+ }
+ }
+ }
+ closedir($handle);
+ }
+ return $array_items;
+ }
+
+ /**
+ * @return Returns true if the given file matches any of the patterns in the $ignore array
+ * @param file
+ * @param ignore
+ * @private
+ */
+ function canIgnore( $file, $ignore )
+ {
+ lt_include( PLOG_CLASS_PATH."class/misc/glob.class.php" );
+
+ $result = false;
+ foreach( $ignore as $pattern ) {
+ if( Glob::myFnMatch( $pattern, $file )) {
+ $result = true;
+ break;
+ }
+ }
+
+ return( $result );
+ }
+
+ /**
+ * Writes the list of files and MD5 hashes to the destination file. If no destination file is given
+ * PLOG_CLASS_PATH/install/files.properties.php is used
+ *
+ * @param folders Array containing the names of the folders to include
+ * @param dest Name of the destination file
+ */
+ function writeMD5ListToFile( $folders = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" ), $dest = "" )
+ {
+ lt_include( PLOG_CLASS_PATH."class/file/file.class.php" );
+
+ if( $dest == "" )
+ $dest = PLOG_CLASS_PATH."install/files.properties.php";
+
+ $currentData = IntegrityChecker::generateMD5Folder( $folders );
+
+ // open the file and write the headers
+ $file = new File( $dest );
+ $file->open( "w+" );
+ $file->write( "<?php\n" );
+ $file->write( "\$data = Array(\n");
+
+ $line = 1;
+ foreach( $currentData as $f => $md5 ) {
+ $file->write( "\"$f\" => \"$md5\"");
+ if( $line < count($currentData ))
+ $file->write( "," );
+ $file->write( "\n" );
+ $line++;
+ }
+
+ // write the footer and close the file
+ $file->write( ");\n");
+ $file->write( "?>" );
+ $file->close();
+
+ return( true );
+ }
+
+ /**
+ * Given the $reference reference array and a list of folders, this method
+ * will calculate the MD5 hashes of the given folders and compare them against the ones
+ * in the reference array.
+ *
+ * @param reference
+ * @param folders
+ * @return An associative array containing the name of the files whose MD5 hash does not match
+ * the current one
+ */
+ function checkIntegrity( $reference, $folders = Array( "class", "templates/admin", "templates/wizard", "templates/rss", "templates/summary", "templates/default" ) )
+ {
+ $currentData = IntegrityChecker::generateMD5Folder( $folders );
+
+ foreach( $currentData as $file => $md5 ) {
+ if( isset( $reference[$file] )) {
+ if( $reference[$file] == $md5 )
+ unset( $reference[$file]);
+ }
+ }
+
+ return( $reference );
+ }
+ }
+?>
\ No newline at end of file
Modified: plog/trunk/class/net/request.class.php
===================================================================
--- plog/trunk/class/net/request.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/net/request.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -57,12 +57,13 @@
*
* @param key
* @param defaultValue
+ * @param filterClass
* @return the value
*/
- function getValue( $key, $defaultValue = null )
+ function getValue( $key, $defaultValue = null, $filterClass = null )
{
// get the value from the parent
- $value = parent::getValue( $key, $defaultValue );
+ $value = parent::getValue( $key, $defaultValue, $filterClass );
// now if magic quotes are enabled and the input parameter is not an array
// and the feature has not been disabled, then strip the slashes
Modified: plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php
===================================================================
--- plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php 2007-06-05 11:38:29 UTC (rev 5487)
+++ plog/trunk/class/net/xmlrpc/xmlrpcserver.class.php 2007-06-05 13:51:03 UTC (rev 5488)
@@ -27,7 +27,7 @@
if ($config->getValue("xmlrpc_api_enabled"))
{
$this->IXR_Server(
- array (
+ array (
"blogger.newPost" => "this:newPost",
"blogger.getPost" => "this:getPost",
"blogger.editPost" => "this:editPost",
@@ -49,7 +49,7 @@
));
}
else {
- // xmlrpc_api disabled, no methods configured
+ // xmlrpc_api disabled, no methods configured
$this->IXR_Server( Array ());
}
}
@@ -67,116 +67,120 @@
$password = $args[3];
$content = $args[4];
$publish = $args[5]; // true post&publish | false post only
- /*
+ /*
int postid
- */
+ */
- // -mhe todo security
+ // -mhe todo security
$userInfo = $users->getUserInfo( $username, $password );
- if ($userInfo) {
-
- $blogInfo = $blogsG->getBlogInfo( $blogid );
- if( !$blogInfo ) {
- return new IXR_Error(-1, 'Error loading blog' );
- }
-
- // check this user's permissions before proceeding
- if( !$this->userHasPermission( $userInfo, $blogInfo, "add_post" )) {
- return new IXR_Error(-1, 'This user does not have enough permissions' );
- }
-
- if ($publish) {
- $status = POST_STATUS_PUBLISHED;
- }
- else {
- $status = POST_STATUS_DRAFT;
- }
+ if (!$userInfo) {
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
- // Get the default category
- $cats = $category->getBlogCategories($blogid);
+ if(!$blogId){
+ $blogs = $userInfo->getBlogs();
+ if(!$blogs){
+ return new IXR_Error(-1, "This user doesn't have access to any blogs.");
+ }
+ $blogid = $blogs[0]->getId();
+ }
+ $blogInfo = $blogsG->getBlogInfo( $blogid );
+ if( !$blogInfo ) {
+ return new IXR_Error(-1, 'Error loading blog' );
+ }
+
+ // check this user's permissions before proceeding
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "add_post" )) {
+ return new IXR_Error(-1, 'This user does not have enough permissions' );
+ }
+
+ if ($publish) {
+ $status = POST_STATUS_PUBLISHED;
+ }
+ else {
+ $status = POST_STATUS_DRAFT;
+ }
+
+ // Get the default category
+ $cats = $category->getBlogCategories($blogid);
+
// some protection again blogs without categories
- if( !$cats ) {
- return new IXR_Error(-1, 'This blog does not have categories!');
- }
-
- foreach($cats as $cat) {
- $idCategory = $cat->getId();
+ if( !$cats ) {
+ return new IXR_Error(-1, 'This blog does not have any categories!');
+ }
+
+ foreach($cats as $cat) {
+ $idCategory = $cat->getId();
// Stop here, we have a category
- break;
- }
+ break;
+ }
// ecto sends the topic as <title>blah blah</title>rest of the body
- if( preg_match( "/<title>(.*)<\/title>(.*)/i", $content, $matches )) {
- $title = $matches[1];
- $content = $matches[2];
- }
- else {
- $dummy = explode("\n", $content);
- if( count( $dummy ) == 1 ) {
- $title = substr( $content, 0, 60 );
- }
- else {
- $title = $dummy[0];
- unset($dummy[0]);
- $content = implode("\n", $dummy);
- unset($dummy);
- }
- }
-
- $article = new Article(
- $title,
- $content, // text
- Array( $idCategory ), // catid
- $userInfo->getId(), // userid
- $blogid, // blogid
- $status,
- 0, // numread
- Array( "comments_enabled" => true ) // enable comments
+ if( preg_match( "/<title>(.*)<\/title>(.*)/i", $content, $matches )) {
+ $title = $matches[1];
+ $content = $matches[2];
+ }
+ else {
+ $dummy = explode("\n", $content);
+ if( count( $dummy ) == 1 ) {
+ $title = substr( $content, 0, 60 );
+ }
+ else {
+ $title = $dummy[0];
+ unset($dummy[0]);
+ $content = implode("\n", $dummy);
+ unset($dummy);
+ }
+ }
+
+ $article = new Article(
+ $title,
+ $content, // text
+ Array( $idCategory ), // catid
+ $userInfo->getId(), // userid
+ $blogid, // blogid
+ $status,
+ 0, // numread
+ Array( "comments_enabled" => true ) // enable comments
);
-
- $article->setDate(date("YmdHis"));
-
+
+ $article->setDate(date("YmdHis"));
+
// Get the plugin manager
- $plugMgr =& PluginManager::getPluginManager();
- $plugMgr->setBlogInfo( $blogInfo);
- $plugMgr->setUserInfo( $userInfo );
- $plugMgr->loadPlugins();
+ $plugMgr =& PluginManager::getPluginManager();
+ $plugMgr->setBlogInfo( $blogInfo);
+ $plugMgr->setUserInfo( $userInfo );
+ $plugMgr->loadPlugins();
// Send the PRE_POST_POST_ADD message
- $plugMgr->notifyEvent( EVENT_PRE_POST_ADD, Array( "article" => &$article ));
-
- $postid = $articles->addArticle($article);
-
- if ($postid != 0) {
- // The post was successful
- // Send the EVENT_POST_POST_ADD messages to the plugins
- $plugMgr->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
- CacheControl::resetBlogCache( $blogid );
-
- $blogSettings = $blogInfo->getSettings();
-
- // Add article notifcations if this is specified by the default setting.
- if ($blogSettings->getValue( "default_send_notification" ))
- {
- lt_include( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
-
- $artNotifications = new ArticleNotifications();
- $artNotifications->addNotification( $postid, $blogid, $userInfo->getId());
- }
-
- $this->setResponseCharset( $blogInfo );
-
- return sprintf( "%d", $postid );
- }
- else {
- return new IXR_Error(-1, 'Internal error occured creating your post!');
- }
- }
- else {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ $plugMgr->notifyEvent( EVENT_PRE_POST_ADD, Array( "article" => &$article ));
+
+ $postid = $articles->addArticle($article);
+
+ if ($postid == 0) {
+ return new IXR_Error(-1, 'Internal error occurred while creating your post!');
+ }
+ // The post was successful
+ // Send the EVENT_POST_POST_ADD messages to the plugins
+ $plugMgr->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+ CacheControl::resetBlogCache( $blogid );
+
+ $blogSettings = $blogInfo->getSettings();
+
+ // Add article notifcations if this is specified by the default setting.
+ if ($blogSettings->getValue( "default_send_notification" ))
+ {
+ lt_include( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
+
+ $artNotifications = new ArticleNotifications();
+ $artNotifications->addNotification( $postid, $blogid, $userInfo->getId());
+ }
+
+ $this->setResponseCharset( $blogInfo );
+
+ return sprintf( "%d", $postid );
}
function metaWeblogNewPost($args)
@@ -191,175 +195,169 @@
$password = $args[2];
$content = $args[3];
$publish = $args[4]; // true post&publish | false post only
- /*
+ /*
int postid
- */
+ */
$userInfo = $users->getUserInfo( $username, $password);
- if( $userInfo ) {
-
- if ($publish) {
- $status = POST_STATUS_PUBLISHED;
- }
- else {
- $status = POST_STATUS_DRAFT;
- }
+ if( !$userInfo ) {
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
+ if ($publish) {
+ $status = POST_STATUS_PUBLISHED;
+ }
+ else {
+ $status = POST_STATUS_DRAFT;
+ }
- $blogInfo = $blogsG->getBlogInfo( $blogid );
- if( !$this->userHasPermission( $userInfo, $blogInfo, "add_post" )) {
- return new IXR_Error(-1, 'This user does not have enough permissions' );
- }
+ $blogInfo = $blogsG->getBlogInfo( $blogid );
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "add_post" )) {
+ return new IXR_Error(-1, 'This user does not have enough permissions' );
+ }
- $title = $content["title"];
+ $title = $content["title"];
// Check to see if the MovableType extnensions have been added
- $mt_excerpt = "";
- $mt_text_more = "";
- $mt_allow_comments = "";
- if( isset( $content["mt_excerpt"] ))
- $mt_excerpt = $content["mt_excerpt"];
- if( isset( $content["mt_text_more"] ))
- $mt_text_more = $content["mt_text_more"];
- if( isset( $content["mt_allow_comments"] ))
- $mt_allow_comments = $content["mt_allow_comments"];
+ $mt_excerpt = "";
+ $mt_text_more = "";
+ $mt_allow_comments = "";
+ if( isset( $content["mt_excerpt"] ))
+ $mt_excerpt = $content["mt_excerpt"];
+ if( isset( $content["mt_text_more"] ))
+ $mt_text_more = $content["mt_text_more"];
+ if( isset( $content["mt_allow_comments"] ))
+ $mt_allow_comments = $content["mt_allow_comments"];
- if ( $mt_text_more != NULL && trim($mt_text_more != ""))
- {
- $body = $content["description"] . POST_EXTENDED_TEXT_MODIFIER . $mt_text_more;
- }
- else
- {
- $body = $content["description"];
- }
- $catList = NULL;
- if( isset( $content["categories"] ))
- $catList = $content["categories"];
+ if ( $mt_text_more != NULL && trim($mt_text_more != ""))
+ {
+ $body = $content["description"] . POST_EXTENDED_TEXT_MODIFIER . $mt_text_more;
+ }
+ else
+ {
+ $body = $content["description"];
+ }
+ $catList = NULL;
+ if( isset( $content["categories"] ))
+ $catList = $content["categories"];
- $categoryName = NULL;
+ $categoryName = NULL;
//
// :KLUDGE:
// not exactly the smartest and fastest bit of code ever but it seems to work :-)
//
- $categories = Array();
- $cats = $category->getBlogCategories($blogid);
+ $categories = Array();
+ $cats = $category->getBlogCategories($blogid);
// some protection again blogs without categories
- if( !$cats ) {
- return new IXR_Error(-1, 'This blog does not have categories!');
- }
+ if( !$cats ) {
+ return new IXR_Error(-1, 'This blog does not have any categories!');
+ }
- if ( $catList != NULL )
- {
- foreach( $catList as $categoryName ) {
- foreach( $cats as $blogCategory ) {
- $categoryName = trim($categoryName);
- if ( strcmp( $categoryName, $blogCategory->getName()) == 0 )
- {
- $categories[] = $blogCategory->getId();
- }
+ if ( $catList != NULL )
+ {
+ foreach( $catList as $categoryName ) {
+ foreach( $cats as $blogCategory ) {
+ $categoryName = trim($categoryName);
+ if ( strcmp( $categoryName, $blogCategory->getName()) == 0 )
+ {
+ $categories[] = $blogCategory->getId();
}
}
}
- else {
+ }
+ else {
// if no category, let's pick a random one
- $blogCategory = array_pop( $cats );
- $categories[] = $blogCategory->getId();
- }
+ $blogCategory = array_pop( $cats );
+ $categories[] = $blogCategory->getId();
+ }
- $userInfo = $users->getUserInfoFromUsername( $username );
+ $userInfo = $users->getUserInfoFromUsername( $username );
// Initially assume that comments are enabled
- $enableComments = true;
+ $enableComments = true;
// Was a setting specified in the MovableType fields?
- if ($mt_allow_comments != NULL)
- {
- $enableComments = $mt_allow_comments;
- }
+ if ($mt_allow_comments != NULL)
+ {
+ $enableComments = $mt_allow_comments;
+ }
- $article = new Article(
- $title,
- $body, // text
- $categories, // catid
- $userInfo->getId(), // userid
- $blogid, // blogid
- $status,
- 0, // numread
- Array( "comments_enabled" => $enableComments )
+ $article = new Article(
+ $title,
+ $body, // text
+ $categories, // catid
+ $userInfo->getId(), // userid
+ $blogid, // blogid
+ $status,
+ 0, // numread
+ Array( "comments_enabled" => $enableComments )
);
- $dateCreated = NULL;
- if( isset( $content['dateCreated'] ))
- $dateCreated = $content['dateCreated'];
+ $dateCreated = NULL;
+ if( isset( $content['dateCreated'] ))
+ $dateCreated = $content['dateCreated'];
- // there must be a bug in the xmlrpc library, we're getting an object in $dateCreated
- // that does not have a type or anyhting, but it still is an object... kinda weird. Anyway,
- // clients like ecto do not allow to change the time an article is posted so this is not
- // too annoying, *yet*
- if (!empty($dateCreated))
- {
- // Convert the UTC time to local time, since articleDate is in local time
- $ar = localtime ( $dateCreated->getTimestamp() );
- $ar[5] += 1900; $ar[4]++;
- $localTimeStamp = gmmktime ( $ar[2], $ar[1], $ar[0], $ar[4], $ar[3], $ar[5], $ar[8] );
- $articleDate = date("YmdHis", $localTimeStamp);
- } else
- {
- $articleDate = date("YmdHis");
- }
+ // there must be a bug in the xmlrpc library, we're getting an object in $dateCreated
+ // that does not have a type or anyhting, but it still is an object... kinda weird. Anyway,
+ // clients like ecto do not allow to change the time an article is posted so this is not
+ // too annoying, *yet*
+ if (!empty($dateCreated))
+ {
+ // Convert the UTC time to local time, since articleDate is in local time
+ $ar = localtime ( $dateCreated->getTimestamp() );
+ $ar[5] += 1900; $ar[4]++;
+ $localTimeStamp = gmmktime ( $ar[2], $ar[1], $ar[0], $ar[4], $ar[3], $ar[5], $ar[8] );
+ $articleDate = date("YmdHis", $localTimeStamp);
+ } else
+ {
+ $articleDate = date("YmdHis");
+ }
- $article->setDate($articleDate);
+ $article->setDate($articleDate);
// Get the plugin manager
- $plugMgr =& PluginManager::getPluginManager();
- $plugMgr->setBlogInfo( $blogInfo );
- $plugMgr->setUserInfo( $userInfo );
- $plugMgr->loadPlugins();
+ $plugMgr =& PluginManager::getPluginManager();
+ $plugMgr->setBlogInfo( $blogInfo );
+ $plugMgr->setUserInfo( $userInfo );
+ $plugMgr->loadPlugins();
// Send the PRE_POST_POST_ADD message
- $plugMgr->notifyEvent( EVENT_PRE_POST_ADD, Array( "article" => &$article ));
+ $plugMgr->notifyEvent( EVENT_PRE_POST_ADD, Array( "article" => &$article ));
- $postid = $articles->addArticle($article);
- if ($postid != 0)
- {
- // The post was successful
+ $postid = $articles->addArticle($article);
+ if ($postid == 0){
+ return new IXR_Error(-1, 'Internal error occurred while creating your post!');
+ }
+ // The post was successful
- // Send the EVENT_POST_POST_ADD messages to the plugins
- $plugMgr->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
+ // Send the EVENT_POST_POST_ADD messages to the plugins
+ $plugMgr->notifyEvent( EVENT_POST_POST_ADD, Array( "article" => &$article ));
- CacheControl::resetBlogCache( $blogid );
+ CacheControl::resetBlogCache( $blogid );
- $blogSettings = $blogInfo->getSettings();
+ $blogSettings = $blogInfo->getSettings();
- // Add article notifcations if this is specified by the default setting.
- if ($blogSettings->getValue( "default_send_notification" ))
- {
- lt_include( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
+ // Add article notifcations if this is specified by the default setting.
+ if ($blogSettings->getValue( "default_send_notification" ))
+ {
+ lt_include( PLOG_CLASS_PATH."class/dao/articlenotifications.class.php" );
- $artNotifications = new ArticleNotifications();
- $artNotifications->addNotification( $postid, $blogid, $userInfo->getId());
- }
+ $artNotifications = new ArticleNotifications();
+ $artNotifications->addNotification( $postid, $blogid, $userInfo->getId());
+ }
- $this->setResponseCharset( $blogInfo );
+ $this->setResponseCharset( $blogInfo );
- return sprintf( "%d", $postid );
- } else
- {
- return new IXR_Error(-1, 'Internal error occured creating your post!');
- }
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ return sprintf( "%d", $postid );
}
- /**
- * @private
- * sets the character set for responses
- */
+ /**
+ * @private
+ * sets the character set for responses
+ */
function setResponseCharset( $blog )
{
$locale = $blog->getLocale();
@@ -367,13 +365,13 @@
}
- /**
- * NOTE: this method does not perform permission checking since if it did,
- * it would be impossible to post: no categories would be available if the
- * view_categories is not available. This is in line with the browser-based UI,
- * there it is not necessary to have this permission in order to post new articles,
- * only add_post is needed
- */
+ /**
+ * NOTE: this method does not perform permission checking since if it did,
+ * it would be impossible to post: no categories would be available if the
+ * view_categories is not available. This is in line with the browser-based UI,
+ * there it is not necessary to have this permission in order to post new articles,
+ * only add_post is needed
+ */
function metaWeblogGetCategories($args)
{
$users = new Users();
@@ -386,37 +384,34 @@
$auth = $users->authenticateUser( $username, $password );
- if ($auth)
- {
- $blogInfo = $blogsG->getBlogInfo( $blogid );
- if( !$blogInfo ) {
- return new IXR_Error(-1, 'Incorrect blog id');
- }
-
- $cats = $category->getBlogCategories($blogid);
- $url = $blogInfo->getBlogRequestGenerator();
- $ret = array();
- foreach($cats as $cat)
- {
- $dummy = array();
- $dummy["description"] = $cat->getDescription();
-
+ if (!$auth){
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
+ $blogInfo = $blogsG->getBlogInfo( $blogid );
+ if( !$blogInfo ) {
+ return new IXR_Error(-1, 'Incorrect blog id');
+ }
+
+ $cats = $category->getBlogCategories($blogid);
+ $url = $blogInfo->getBlogRequestGenerator();
+ $ret = array();
+ foreach($cats as $cat)
+ {
+ $dummy = array();
+ $dummy["description"] = $cat->getDescription();
+
// disable the generation of xhtml content or else the IXR_XMLRPC library will
// escape things twice!
- $url->setXHTML( false );
-
- $dummy["htmlUrl"] = $url->categoryLink( $cat );
- $dummy["rssUrl"] = "http://";
- $ret[$cat->getName()] = $dummy;
- }
-
- $this->setResponseCharset( $blogInfo );
-
- return $ret;
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ $url->setXHTML( false );
+
+ $dummy["htmlUrl"] = $url->categoryLink( $cat );
+ $dummy["rssUrl"] = "http://";
+ $ret[$cat->getName()] = $dummy;
+ }
+
+ $this->setResponseCharset( $blogInfo );
+
+ return $ret;
}
function mtGetCategoryList($args)
@@ -431,32 +426,29 @@
$auth = $users->authenticateUser( $username, $password );
- if ($auth)
- {
- $blogInfo = $blogsG->getBlogInfo( $blogid );
- if( !$blogInfo ) {
- return new IXR_Error(-1, 'Incorrect blog id');
- }
-
- $cats = $category->getBlogCategories($blogid);
- $url = $blogInfo->getBlogRequestGenerator();
- $ret = array();
- foreach($cats as $cat)
- {
- $dummy = array();
- $dummy["categoryId"] = $cat->getId();
- $dummy["categoryName"] = $cat->getName();
-
- $ret[] = $dummy;
- }
-
- $this->setResponseCharset( $blogInfo );
-
- return $ret;
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ if (!$auth){
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
+ $blogInfo = $blogsG->getBlogInfo( $blogid );
+ if( !$blogInfo ) {
+ return new IXR_Error(-1, 'Incorrect blog id');
+ }
+
+ $cats = $category->getBlogCategories($blogid);
+ $url = $blogInfo->getBlogRequestGenerator();
+ $ret = array();
+ foreach($cats as $cat)
+ {
+ $dummy = array();
+ $dummy["categoryId"] = $cat->getId();
+ $dummy["categoryName"] = $cat->getName();
+
+ $ret[] = $dummy;
+ }
+
+ $this->setResponseCharset( $blogInfo );
+
+ return $ret;
}
function getPost($args)
@@ -479,38 +471,36 @@
*/
$userInfo = $users->getUserInfo($username,$password);
- if( $userInfo ) {
- $item = $articles->getBlogArticle($postid,
- -1, // blogId
- true, // includeHiddenFields
- -1, // date
- -1, // categoryId
- $userInfo->getId());
- $dateObject = $item->getDateObject();
+ if( !$userInfo ) {
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
+ $item = $articles->getBlogArticle($postid,
+ -1, // blogId
+ true, // includeHiddenFields
+ -1, // date
+ -1, // categoryId
+ $userInfo->getId());
+ $dateObject = $item->getDateObject();
// Get the unix time stamp
- $time = $dateObject->getTimestamp(DATE_FORMAT_UNIXTIME);
-
- $dummy = array();
- $userInfo = $item->getUserInfo();
- $dummy["userid"] = $userInfo->getId();
- $dummy["dateCreated"] = new IXR_Date($time);
- $dummy["content"] = $item->getTopic() . "\r\n" . $item->getText(false) . " ";
- $dummy["postid"] = $item->getId();
-
- $blogInfo = $item->getBlogInfo();
-
+ $time = $dateObject->getTimestamp(DATE_FORMAT_UNIXTIME);
+
+ $dummy = array();
+ $userInfo = $item->getUserInfo();
+ $dummy["userid"] = $userInfo->getId();
+ $dummy["dateCreated"] = new IXR_Date($time);
+ $dummy["content"] = $item->getTopic() . "\r\n" . $item->getText(false) . " ";
+ $dummy["postid"] = $item->getId();
+
+ $blogInfo = $item->getBlogInfo();
+
// check the permissions
- if( !$this->userHasPermission( $userInfo, $blogInfo, "view_posts" )) {
- return new IXR_Error(-1, 'This user does not have enough permissions' );
- }
-
- $this->setResponseCharset( $blogInfo );
-
- return $dummy;
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "view_posts" )) {
+ return new IXR_Error(-1, 'This user does not have enough permissions' );
+ }
+
+ $this->setResponseCharset( $blogInfo );
+
+ return $dummy;
}
function metaWeblogGetPost($args)
@@ -524,71 +514,69 @@
$userInfo = $users->getUserInfo( $username, $password );
- if( $userInfo )
- {
- lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+ if( !$userInfo ){
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
- $item = $articles->getBlogArticle($postid,
- -1, // blogId
- true, // includeHiddenFields
- -1, // date
- -1, // categoryId
- $userInfo->getId());
-
+ lt_include( PLOG_CLASS_PATH."class/data/timestamp.class.php" );
+
+ $item = $articles->getBlogArticle($postid,
+ -1, // blogId
+ true, // includeHiddenFields
+ -1, // date
+ -1, // categoryId
+ $userInfo->getId());
+
// check if the article is valid
- if( !$item ) {
- return( new IXR_Error(-1, 'The article is not valid' ));
- }
-
+ if( !$item ) {
+ return( new IXR_Error(-1, 'The article is not valid' ));
+ }
+
// check permissions
- $blogInfo = $item->getBlogInfo();
- if( !$this->userHasPermission( $userInfo, $blogInfo, "view_posts" )) {
- return( new IXR_Error(-1, 'This user does not have enough permissions' ));
- }
-
- $dateObject = $item->getDateObject();
+ $blogInfo = $item->getBlogInfo();
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "view_posts" )) {
+ return( new IXR_Error(-1, 'This user does not have enough permissions' ));
+ }
+
+ $dateObject = $item->getDateObject();
// Get the unix time stamp
- $time = $dateObject->getTimestamp(DATE_FORMAT_UNIXTIME);
+ $time = $dateObject->getTimestamp(DATE_FORMAT_UNIXTIME);
+
+ $articleCat = $item->getCategory();
+
+ $blogId = $item->getBlog();
+ $blogs = new Blogs();
+ $url = $blogInfo->getBlogRequestGenerator();
+
+ $dummy = array();
+ $userInfo = $item->getUserInfo();
+ $dummy["userid"] = $userInfo->getId();
+ $dummy["dateCreated"] = new IXR_Date($time);
+ $dummy["title"] = $item->getTopic();
+
+ $blogSettings = $blogInfo->getSettings();
+
+ $dummy["description"] = $item->getIntroText();
+
+ $dummy["postid"] = $item->getId();
+
+ $dummy["link"] = $url->postLink( $item );
+ $dummy["permaLink"] = $url->postPermalink( $item );
- $articleCat = $item->getCategory();
+ $catArray = array();
+ foreach( $item->getCategories() as $category ) {
+ $catArray[] = $category->getName();
+ }
+ $dummy["categories"] = $catArray;
- $blogId = $item->getBlog();
- $blogs = new Blogs();
- $url = $blogInfo->getBlogRequestGenerator();
-
- $dummy = array();
- $userInfo = $item->getUserInfo();
- $dummy["userid"] = $userInfo->getId();
- $dummy["dateCreated"] = new IXR_Date($time);
- $dummy["title"] = $item->getTopic();
-
- $blogSettings = $blogInfo->getSettings();
-
- $dummy["description"] = $item->getIntroText();
-
- $dummy["postid"] = $item->getId();
-
- $dummy["link"] = $url->postLink( $item );
- $dummy["permaLink"] = $url->postPermalink( $item );
-
- $catArray = array();
- foreach( $item->getCategories() as $category ) {
- $catArray[] = $category->getName();
- }
- $dummy["categories"] = $catArray;
-
// The MovableType Extensions
- $dummy["mt_text_more"] = $item->getExtendedText();
- $dummy["mt_allow_comments"] = $item->getCommentsEnabled();
+ $dummy["mt_text_more"] = $item->getExtendedText();
+ $dummy["mt_allow_comments"] = $item->getCommentsEnabled();
- $this->setResponseCharset( $blogInfo );
+ $this->setResponseCharset( $blogInfo );
- return $dummy;
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ return $dummy;
}
function editPost($args)
@@ -609,71 +597,69 @@
*/
$userInfo = $users->getUserInfo( $username, $password );
- if( $userInfo ) {
+ if( !$userInfo ) {
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
// fake topic
- $dummy = explode("\n", $content);
- if( count($dummy) == 1 ) {
- $title = substr( $content, 0, 60 );
- }
- else {
- $title = $dummy[0];
- unset($dummy[0]);
- $content = implode("\n", $dummy);
- unset($dummy);
- }
+ $dummy = explode("\n", $content);
+ if( count($dummy) == 1 ) {
+ $title = substr( $content, 0, 60 );
+ }
+ else {
+ $title = $dummy[0];
+ unset($dummy[0]);
+ $content = implode("\n", $dummy);
+ unset($dummy);
+ }
- $article = $articles->getBlogArticle($postid,
- -1, // blogId
- true, // includeHiddenFields
- -1, // date
- -1, // categoryId
- $userInfo->getId());
+ $article = $articles->getBlogArticle($postid,
+ -1, // blogId
+ true, // includeHiddenFields
+ -1, // date
+ -1, // categoryId
+ $userInfo->getId());
- if( !$article ) {
- return( new IXR_Error(-1, 'The article is not correct' ));
- }
+ if( !$article ) {
+ return( new IXR_Error(-1, 'The article id is not correct' ));
+ }
- $blogInfo = $article->getBlogInfo();
+ $blogInfo = $article->getBlogInfo();
// check the permissions
- if( !$this->userHasPermission( $userInfo, $blogInfo, "update_post" )) {
- return new IXR_Error(-1, 'This user does not have enough permissions' );
- }
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "update_post" )) {
+ return new IXR_Error(-1, 'This user does not have enough permissions' );
+ }
- if ($publish) {
- $status = POST_STATUS_PUBLISHED;
- }
- else {
- $status = POST_STATUS_DRAFT;
- }
+ if ($publish) {
+ $status = POST_STATUS_PUBLISHED;
+ }
+ else {
+ $status = POST_STATUS_DRAFT;
+ }
- $article->setText($content);
- $article->setTopic($title);
- $article->setStatus($status);
+ $article->setText($content);
+ $article->setTopic($title);
+ $article->setStatus($status);
// Get the plugin manager
- $plugMgr =& PluginManager::getPluginManager();
- $plugMgr->setBlogInfo( $blogInfo );
- $plugMgr->setUserInfo( $userInfo );
- $plugMgr->loadPlugins();
+ $plugMgr =& PluginManager::getPluginManager();
+ $plugMgr->setBlogInfo( $blogInfo );
+ $plugMgr->setUserInfo( $userInfo );
+ $plugMgr->loadPlugins();
// Send the EVENT_PRE_POST_UPDATE message
- $plugMgr->notifyEvent( EVENT_PRE_POST_UPDATE, Array( "article" => &$article ));
+ $plugMgr->notifyEvent( EVENT_PRE_POST_UPDATE, Array( "article" => &$article ));
- $articles->updateArticle($article);
+ $articles->updateArticle($article);
// Send the EVENT_POST_POST_UPDATE messages to the plugins
- $plugMgr->notifyEvent( EVENT_POST_POST_UPDATE, Array( "article" => &$article ));
+ $plugMgr->notifyEvent( EVENT_POST_POST_UPDATE, Array( "article" => &$article ));
- CacheControl::resetBlogCache( $blogInfo->getId());
+ CacheControl::resetBlogCache( $blogInfo->getId());
- $this->setResponseCharset( $blogInfo );
+ $this->setResponseCharset( $blogInfo );
- return true;
- } else
- {
- return new IXR_Error(-1, 'You did not provide the correct password');
- }
+ return true;
}
function metaWeblogEditPost($args)
@@ -693,107 +679,104 @@
*/
$userInfo = $users->getUserInfo( $username, $password );
- if( $userInfo ) {
-
- if ($publish) {
- $status = POST_STATUS_PUBLISHED;
- }
- else {
- $status = POST_STATUS_DRAFT;
- }
+ if( !$userInfo ) {
+ return new IXR_Error(-1, 'You did not provide the correct username and/or password');
+ }
+ if ($publish) {
+ $status = POST_STATUS_PUBLISHED;
+ }
+ else {
+ $status = POST_STATUS_DRAFT;
+ }
- $title = $content["title"];
+ $title = $content["title"];
// Check to see if the MovableType extnensions have been added
- $mt_excerpt = $content["mt_excerpt"];
- $mt_text_more = $content["mt_text_more"];
- $mt_allow_comments = $content["mt_allow_comments"];
+ $mt_excerpt = $content["mt_excerpt"];
+ $mt_text_more = $content["mt_text_more"];
+ $mt_allow_comments = $content["mt_allow_comments"];
- if ( $mt_text_more != NULL && trim($mt_text_more) != "") {
- $body = $content["description"] . POST_EXTENDED_TEXT_MODIFIER . $mt_text_more;
- }
- else {
- $body = $content["description"];
- }
+ if ( $mt_text_more != NULL && trim($mt_text_more) != "") {
+ $body = $content["description"] . POST_EXTENDED_TEXT_MODIFIER . $mt_text_more;
+ }
+ else {
+ $body = $content["description"];
+ }
- $article = $articles->getBlogArticle($postid,
- -1, // blogId
- true, // includeHiddenFields
- -1, // date
- -1, // categoryId
- $userInfo->getId());
+ $article = $articles->getBlogArticle($postid,
+ -1, // blogId
+ true, // includeHiddenFields
+ -1, // date
+ -1, // categoryId
+ $userInfo->getId());
// check that the article is valid
- if( !$article ) {
- return( new IXR_Error(-1, 'Incorrect article' ));
- }
+ if( !$article ) {
+ return( new IXR_Error(-1, 'Incorrect article id' ));
+ }
// see that the user can update articles
- $blogid = $article->getBlog();
- $blogInfo = $article->getBlogInfo();
- if( !$this->userHasPermission( $userInfo, $blogInfo, "update_post" )) {
- return( new IXR_Error(-1, 'This user does not have enough permissions' ));
- }
+ $blogid = $article->getBlog();
+ $blogInfo = $article->getBlogInfo();
+ if( !$this->userHasPermission( $userInfo, $blogInfo, "update_post" )) {
+ return( new IXR_Error(-1, 'This user does not have enough permissions' ));
+ }
- $catList = NULL;
- if ( array_key_exists( "categories", $content ) ) {
- $catList = $content["categories"];
- }
+ $catList = NULL;
+ if ( array_key_exists( "categories", $content ) ) {
+ $catList = $content["categories"];
+ }
//
// :KLUDGE:
// not exactly the smartest and fastest bit of code ever but it seems to work :-)
//
- $categories = Array();
- $cats = $category->getBlogCategories($blogid);
- if ( $catList != NULL )
- {
- foreach( $catList as $categoryName ) {
- foreach( $cats as $blogCategory ) {
- $categoryName = trim($categoryName);
- if ( strcmp( $categoryName, $blogCategory->getName()) == 0 )
- {
- $categories[] = $blogCategory->getId();
- }
- }
- }
- $article->setCategoryIds( $categories );
- }
- else if ( count($article->getCategories()) == 0) {
+ $categories = Array();
+ $cats = $category->getBlogCategories($blogid);
+ if ( $catList != NULL )
+ {
+ foreach( $catList as $categoryName ) {
+ foreach( $cats as $blogCategory ) {
+ $categoryName = trim($categoryName);
+ if ( strcmp( $categoryName, $blogCategory->getName()) == 0 )
+ {
+ $categories[] = $blogCategory->getId();
+ }
+ }
+ }
+ $article->setCategoryIds( $categories );
+ }
+ else if ( count($article->getCategories()) == 0) {
// Only assign a new category if there isn't one
// if no category, let's pick a random one
- $blogCategory = array_pop( $cats );
- $categories[] = $blogCategory->getId();
+ $blogCategory = array_pop( $cats );
+ $categories[] = $blogCategory->getId();
- $article->setCategoryIds( $categories );
- }
+ $article->