From: <var...@us...> - 2012-10-06 10:28:43
|
Revision: 8398 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=8398&view=rev Author: vargenau Date: 2012-10-06 10:28:33 +0000 (Sat, 06 Oct 2012) Log Message: ----------- Reformat code Modified Paths: -------------- trunk/ImageTile.php trunk/RPC2.php trunk/SOAP.php trunk/admin/wiki2public.php trunk/configurator.php trunk/index.php trunk/lib/AccessLog.php trunk/lib/ArchiveCleaner.php trunk/lib/AtomParser.php trunk/lib/BlockParser.php trunk/lib/CachedMarkup.php trunk/lib/Captcha.php trunk/lib/DbSession/ADODB.php trunk/lib/DbSession/PDO.php trunk/lib/DbSession/SQL.php trunk/lib/DbSession/dba.php trunk/lib/DbSession.php trunk/lib/DbaDatabase.php trunk/lib/DbaListSet.php trunk/lib/DbaPartition.php trunk/lib/EditToolbar.php trunk/lib/ErrorManager.php trunk/lib/ExternalReferrer.php trunk/lib/FileFinder.php trunk/lib/Google.php trunk/lib/HtmlElement.php trunk/lib/HtmlElement5.php trunk/lib/HtmlParser.php trunk/lib/HttpClient.php trunk/lib/IniConfig.php trunk/lib/InlineParser.php trunk/lib/MailNotify.php trunk/lib/PageList.php trunk/lib/PagePerm.php trunk/lib/PageType.php trunk/lib/RSSWriter091.php trunk/lib/Request.php trunk/lib/RssParser.php trunk/lib/RssWriter.php trunk/lib/RssWriter2.php trunk/lib/SemanticWeb.php trunk/lib/SpamBlocklist.php trunk/lib/Template.php trunk/lib/TextSearchQuery.php trunk/lib/Units.php trunk/lib/WikiCallback.php trunk/lib/WikiDB/ADODB.php trunk/lib/WikiDB/PDO.php trunk/lib/WikiDB/SQL.php trunk/lib/WikiDB/adodb/adodb-csvlib.inc.php trunk/lib/WikiDB/adodb/adodb-error.inc.php trunk/lib/WikiDB/adodb/adodb-errorhandler.inc.php trunk/lib/WikiDB/adodb/adodb-errorpear.inc.php trunk/lib/WikiDB/adodb/adodb-exceptions.inc.php trunk/lib/WikiDB/adodb/adodb-iterator.inc.php trunk/lib/WikiDB/adodb/adodb-lib.inc.php trunk/lib/WikiDB/adodb/adodb-pear.inc.php trunk/lib/WikiDB/adodb/adodb-php4.inc.php trunk/lib/WikiDB/adodb/adodb-time.inc.php trunk/lib/WikiDB/adodb/adodb.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-access.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado_access.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ado_mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-borland_ibase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-csv.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-db2.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-fbsql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-firebird.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ibase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-informix.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssqlnative.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mssqlpo.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysqli.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-mysqlt.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-netezza.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci8.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci805.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oci8po.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc_mssql.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbc_oracle.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbtp.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-oracle.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-postgres7.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-proxy.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sapdb.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlanywhere.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sqlite.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-sybase.inc.php trunk/lib/WikiDB/adodb/drivers/adodb-vfp.inc.php trunk/lib/WikiDB/adodb/readme.htm trunk/lib/WikiDB/backend/ADODB.php trunk/lib/WikiDB/backend/ADODB_mssql.php trunk/lib/WikiDB/backend/ADODB_mssqlnative.php trunk/lib/WikiDB/backend/ADODB_mysql.php trunk/lib/WikiDB/backend/ADODB_oci8po.php trunk/lib/WikiDB/backend/ADODB_postgres7.php trunk/lib/WikiDB/backend/ADODB_sqlite.php trunk/lib/WikiDB/backend/PDO.php trunk/lib/WikiDB/backend/PDO_mysql.php trunk/lib/WikiDB/backend/PDO_oci8.php trunk/lib/WikiDB/backend/PDO_pgsql.php trunk/lib/WikiDB/backend/PearDB.php trunk/lib/WikiDB/backend/PearDB_ffpgsql.php trunk/lib/WikiDB/backend/PearDB_mysql.php trunk/lib/WikiDB/backend/PearDB_oci8.php trunk/lib/WikiDB/backend/PearDB_pgsql.php trunk/lib/WikiDB/backend/PearDB_sqlite.php trunk/lib/WikiDB/backend/cvs.php trunk/lib/WikiDB/backend/dba.php trunk/lib/WikiDB/backend/dbaBase.php trunk/lib/WikiDB/backend/dumb/AllRevisionsIter.php trunk/lib/WikiDB/backend/dumb/BackLinkIter.php trunk/lib/WikiDB/backend/dumb/LinkSearchIter.php trunk/lib/WikiDB/backend/dumb/MostPopularIter.php trunk/lib/WikiDB/backend/dumb/MostRecentIter.php trunk/lib/WikiDB/backend/dumb/TextSearchIter.php trunk/lib/WikiDB/backend/dumb/WantedPagesIter.php trunk/lib/WikiDB/backend/file.php trunk/lib/WikiDB/backend/flatfile.php trunk/lib/WikiDB/backend.php trunk/lib/WikiDB/cvs.php trunk/lib/WikiDB/dba.php trunk/lib/WikiDB/file.php trunk/lib/WikiDB/flatfile.php trunk/lib/WikiDB.php trunk/lib/WikiGroup.php trunk/lib/WikiPlugin.php trunk/lib/WikiPluginCached.php trunk/lib/WikiTheme.php trunk/lib/WikiUser/AdoDb.php trunk/lib/WikiUser/BogoLogin.php trunk/lib/WikiUser/Db.php trunk/lib/WikiUser/EMailConfirm.php trunk/lib/WikiUser/Facebook.php trunk/lib/WikiUser/File.php trunk/lib/WikiUser/Forbidden.php trunk/lib/WikiUser/FusionForge.php trunk/lib/WikiUser/HttpAuth.php trunk/lib/WikiUser/HttpAuthUpper.php trunk/lib/WikiUser/IMAP.php trunk/lib/WikiUser/LDAP.php trunk/lib/WikiUser/LdapUpper.php trunk/lib/WikiUser/OpenID.php trunk/lib/WikiUser/POP3.php trunk/lib/WikiUser/PdoDb.php trunk/lib/WikiUser/PearDb.php trunk/lib/WikiUser/PersonalPage.php trunk/lib/WikiUser/Session.php trunk/lib/WikiUser.php trunk/lib/WikiUserNew.php trunk/lib/WysiwygEdit/FCKeditor.php trunk/lib/WysiwygEdit/Wikiwyg.php trunk/lib/WysiwygEdit/htmlarea2.php trunk/lib/WysiwygEdit/htmlarea3.php trunk/lib/WysiwygEdit/spaw.php trunk/lib/WysiwygEdit/tinymce.php trunk/lib/WysiwygEdit.php trunk/lib/XMLRPC/utils.php trunk/lib/XMLRPC/xmlrpc.inc trunk/lib/XMLRPC/xmlrpc_emu.inc trunk/lib/XMLRPC/xmlrpcs.inc trunk/lib/XMLRPC/xmlrpcs_emu.inc trunk/lib/XmlElement.php trunk/lib/XmlParser.php trunk/lib/XmlRpcClient.php trunk/lib/XmlRpcServer.php trunk/lib/config.php trunk/lib/diff.php trunk/lib/diff3.php trunk/lib/difflib.php trunk/lib/display.php trunk/lib/editpage.php trunk/lib/fortune.php trunk/lib/fpdf/chinese.php trunk/lib/fpdf/courier.php trunk/lib/fpdf/helvetica.php trunk/lib/fpdf/helveticab.php trunk/lib/fpdf/helveticabi.php trunk/lib/fpdf/helveticai.php trunk/lib/fpdf/japanese.php trunk/lib/fpdf/symbol.php trunk/lib/fpdf/times.php trunk/lib/fpdf/timesb.php trunk/lib/fpdf/timesbi.php trunk/lib/fpdf/timesi.php trunk/lib/fpdf/zapfdingbats.php trunk/lib/fpdf.php trunk/lib/gif.php trunk/lib/imagecache.php trunk/lib/imdb.php trunk/lib/install.php trunk/lib/loadsave.php trunk/lib/main.php trunk/lib/nusoap/nusoap.php trunk/lib/pdf.php trunk/lib/plugin/SystemInfo.php trunk/lib/prepend.php trunk/lib/purgepage.php trunk/lib/removepage.php trunk/lib/spam_babycart.php trunk/lib/stdlib.php trunk/lib/wikilens/Buddy.php trunk/lib/wikilens/CustomPrefs.php trunk/lib/wikilens/PageListColumns.php trunk/lib/wikilens/RatingsDb.php trunk/lib/wikilens/RatingsUser.php trunk/lib/wikilens/Utils.php trunk/lib/ziplib.php trunk/passencrypt.php trunk/themes/Crao/themeinfo.php trunk/themes/Hawaiian/lib/random.php trunk/themes/Hawaiian/themeinfo.php trunk/themes/MacOSX/images/index.php trunk/themes/MacOSX/lib/RecentChanges.php trunk/themes/MacOSX/themeinfo.php trunk/themes/MonoBook/themeinfo.php trunk/themes/Portland/lib/RecentChanges.php trunk/themes/Portland/themeinfo.php trunk/themes/Sidebar/clock.php trunk/themes/Sidebar/hyperapplet.php trunk/themes/Sidebar/hyperwiki.php trunk/themes/Sidebar/themeinfo.php trunk/themes/SpaceWiki/lib/RecentChanges.php trunk/themes/SpaceWiki/themeinfo.php trunk/themes/Wordpress/lib/RecentChanges.php trunk/themes/Wordpress/themeinfo.php trunk/themes/alphatest.php trunk/themes/blog/lib/RecentChanges.php trunk/themes/blog/themeinfo.php trunk/themes/fusionforge/themeinfo.php trunk/themes/shamino_com/themeinfo.php trunk/themes/smaller/themeinfo.php trunk/themes/wikilens/themeinfo.php trunk/uploads/index.php trunk/view.php trunk/wikiadmin.php trunk/wikilist.php Modified: trunk/ImageTile.php =================================================================== --- trunk/ImageTile.php 2012-10-05 16:47:39 UTC (rev 8397) +++ trunk/ImageTile.php 2012-10-06 10:28:33 UTC (rev 8398) @@ -3,38 +3,38 @@ require_once 'lib/stdlib.php'; $remove = 0; -if (preg_match('/^(http|ftp|https):\/\//i',$_REQUEST['url'])) { +if (preg_match('/^(http|ftp|https):\/\//i', $_REQUEST['url'])) { $data_path = ''; list($usec, $sec) = explode(" ", microtime()); - $fp = fopen('config/config.ini','r'); - while ($config = fgetcsv($fp,1024,';')) { - if (preg_match('/DATA_PATH/',$config[0])) { - list($key,$value) = explode('=', $config[0]); - $data_path = trim($value).'/'; - break; + $fp = fopen('config/config.ini', 'r'); + while ($config = fgetcsv($fp, 1024, ';')) { + if (preg_match('/DATA_PATH/', $config[0])) { + list($key, $value) = explode('=', $config[0]); + $data_path = trim($value) . '/'; + break; + } } - } fclose($fp); - @mkdir($data_path."uploads/thumbs",0775); - $file = $data_path."uploads/thumbs/image_" . ((float)$usec + (float)$sec); + @mkdir($data_path . "uploads/thumbs", 0775); + $file = $data_path . "uploads/thumbs/image_" . ((float)$usec + (float)$sec); $source = url_get_contents($_REQUEST['url']); - @$fp = fopen($file,'w+'); + @$fp = fopen($file, 'w+'); if (!$fp) { - header ("Content-type: text/html"); + header("Content-type: text/html"); echo "<html><head></head><body>ERROR : unable to open $file in write mode</body></html>"; } - fwrite($fp,$source); + fwrite($fp, $source); $remove = 1; } else { - @$fp = fopen($_REQUEST['url'],"r"); + @$fp = fopen($_REQUEST['url'], "r"); if (!$fp) { - header ("Content-type: text/html"); + header("Content-type: text/html"); echo "<html><head></head><body>Not an image</body></html>"; exit(); @@ -43,83 +43,83 @@ fclose($fp); } } -list ($a, $b, $type, $attr) = @getimagesize ($file); +list ($a, $b, $type, $attr) = @getimagesize($file); if (!$type) { - $type = basename ($_REQUEST['url']); - $type = preg_split ('/\./',$type); - $type = array_pop ($type); + $type = basename($_REQUEST['url']); + $type = preg_split('/\./', $type); + $type = array_pop($type); } switch ($type) { case '2': if (function_exists("imagecreatefromjpeg")) - $img = @imagecreatefromjpeg ($file); + $img = @imagecreatefromjpeg($file); else - show_plain ($file); + show_plain($file); break; case '3': if (function_exists("imagecreatefrompng")) - $img = @imagecreatefrompng ($file); + $img = @imagecreatefrompng($file); else - show_plain ($file); + show_plain($file); break; case '1': if (function_exists("imagecreatefromgif")) - $img = @imagecreatefromgif ($file); + $img = @imagecreatefromgif($file); else - show_plain ($file); + show_plain($file); break; case '15': if (function_exists("imagecreatefromwbmp")) - $img = @imagecreatefromwbmp ($file); + $img = @imagecreatefromwbmp($file); else - show_plain ($file); + show_plain($file); break; case '16': if (function_exists("imagecreatefromxbm")) - $img = @imagecreatefromxbm ($file); + $img = @imagecreatefromxbm($file); else - show_plain ($file); + show_plain($file); break; case 'xpm': if (function_exists("imagecreatefromxpm")) - $img = @imagecreatefromxpm ($file); + $img = @imagecreatefromxpm($file); else - show_plain ($file); + show_plain($file); break; case 'gd': if (function_exists("imagecreatefromgd")) - $img = @imagecreatefromgd ($file); + $img = @imagecreatefromgd($file); else - show_plain ($file); + show_plain($file); break; case 'gd2': if (function_exists("imagecreatefromgd2")) - $img = @imagecreatefromgd2 ($file); + $img = @imagecreatefromgd2($file); else - show_plain ($file); + show_plain($file); break; default: //we are not stupid... - header ("Content-type: text/html"); + header("Content-type: text/html"); echo "<html><head></head><body>Not an image</body></html>"; exit(); break; } -$width = @imagesx($img); +$width = @imagesx($img); $height = @imagesy($img); $newwidth = $_REQUEST['width']; if (empty($newidth)) $newidth = 50; $newheight = $_REQUEST['height']; -if (empty($newheight)) $newheight = round($newwidth * ($height / $width)) ; +if (empty($newheight)) $newheight = round($newwidth * ($height / $width)); // php-4.2.x is stupid enough to define on gd only a stub for imagecopyresampled. // So function_exists('imagecopyresampled') will fail. -if (!extension_loaded('gd2') and (substr(PHP_OS,0,3) != 'WIN')) +if (!extension_loaded('gd2') and (substr(PHP_OS, 0, 3) != 'WIN')) loadPhpExtension('gd2'); if (extension_loaded('gd2')) { $thumb = imagecreatetruecolor($newwidth, $newheight); @@ -129,14 +129,15 @@ $img = imagecopyresized($thumb, $img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); } -if ($remove == 1) unlink ($file); +if ($remove == 1) unlink($file); -header ("Content-type: image/png"); +header("Content-type: image/png"); imagepng($thumb); -function show_plain () { - $mime = mime_content_type ($_REQUEST['url']); - header ("Content-type: $mime"); +function show_plain() +{ + $mime = mime_content_type($_REQUEST['url']); + header("Content-type: $mime"); readfile($_REQUEST['url']); exit(); } Modified: trunk/RPC2.php =================================================================== --- trunk/RPC2.php 2012-10-05 16:47:39 UTC (rev 8397) +++ trunk/RPC2.php 2012-10-06 10:28:33 UTC (rev 8398) @@ -10,9 +10,8 @@ // Intercept GET requests from confused users. Only POST is allowed here! if (empty($GLOBALS['HTTP_SERVER_VARS'])) - $GLOBALS['HTTP_SERVER_VARS'] =& $_SERVER; -if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != "POST") -{ + $GLOBALS['HTTP_SERVER_VARS'] =& $_SERVER; +if ($HTTP_SERVER_VARS['REQUEST_METHOD'] != "POST") { die('This is the address of the XML-RPC interface.' . ' You must use XML-RPC calls to access information here.'); } Modified: trunk/SOAP.php =================================================================== --- trunk/SOAP.php 2012-10-05 16:47:39 UTC (rev 8397) +++ trunk/SOAP.php 2012-10-06 10:28:33 UTC (rev 8398) @@ -37,11 +37,12 @@ require_once 'lib/WikiGroup.php'; */ -function checkCredentials(&$server, &$credentials, $access, $pagename) { +function checkCredentials(&$server, &$credentials, $access, $pagename) +{ // check the "Authorization: Basic '.base64_encode("$this->username:$this->password").'\r\n'" header if (isset($server->header['Authorization'])) { - $line = base64_decode(str_replace("Basic ","",trim($server->header['Authorization']))); - list($credentials['username'],$credentials['password']) = explode(':',$line); + $line = base64_decode(str_replace("Basic ", "", trim($server->header['Authorization']))); + list($credentials['username'], $credentials['password']) = explode(':', $line); } else { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; @@ -50,8 +51,7 @@ if (isset($_SERVER['REMOTE_ADDR'])) $credentials['username'] = $_SERVER['REMOTE_ADDR']; elseif (isset($GLOBALS['REMOTE_ADDR'])) - $credentials['username'] = $GLOBALS['REMOTE_ADDR']; - else + $credentials['username'] = $GLOBALS['REMOTE_ADDR']; else $credentials['username'] = $server->host; } } @@ -64,9 +64,9 @@ $request->_user = new WikiUser($request, $credentials['username']); } $request->_user->AuthCheck(array('userid' => $credentials['username'], - 'passwd' => $credentials['password'])); - if (! mayAccessPage ($access, $pagename)) - $server->fault(401,'',"no permission"); + 'passwd' => $credentials['password'])); + if (!mayAccessPage($access, $pagename)) + $server->fault(401, '', "no permission"); } $GLOBALS['SERVER_NAME'] = SERVER_URL; @@ -76,22 +76,22 @@ // Local or external wdsl support is experimental. // It works without also. Just the client has to // know the wdsl definitions. -$server = new soap_server(/* 'PhpWiki.wdsl' */); +$server = new soap_server( /* 'PhpWiki.wdsl' */); // Now change the server url to ours, because in the wdsl is the original PhpWiki address // <soap:address location="http://phpwiki.sourceforge.net/phpwiki/SOAP.php" /> // <soap:operation soapAction="http://phpwiki.sourceforge.net/phpwiki/SOAP.php" /> $server->ports[$server->currentPort]['location'] = $url; -$server->bindings[ $server->ports[$server->currentPort]['binding'] ]['endpoint'] = $url; +$server->bindings[$server->ports[$server->currentPort]['binding']]['endpoint'] = $url; $server->soapaction = $url; // soap_transport_http -$actions = array('getPageContent','getPageRevision','getCurrentRevision', - 'getPageMeta','doSavePage','getAllPagenames', - 'getBackLinks','doTitleSearch','doFullTextSearch', - 'getRecentChanges','listLinks','listPlugins', - 'getPluginSynopsis','callPlugin','listRelations', - 'linkSearch' - ); +$actions = array('getPageContent', 'getPageRevision', 'getCurrentRevision', + 'getPageMeta', 'doSavePage', 'getAllPagenames', + 'getBackLinks', 'doTitleSearch', 'doFullTextSearch', + 'getRecentChanges', 'listLinks', 'listPlugins', + 'getPluginSynopsis', 'callPlugin', 'listRelations', + 'linkSearch' +); foreach ($actions as $action) { $server->register($actions); $server->operations[$actions]['soapaction'] = $url; @@ -100,9 +100,10 @@ //todo: check and set credentials // requiredAuthorityForPage($action); // require 'edit' access -function doSavePage($pagename,$content,$credentials=false) { +function doSavePage($pagename, $content, $credentials = false) +{ global $server; - checkCredentials($server, $credentials,'edit',$pagename); + checkCredentials($server, $credentials, 'edit', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $current = $page->getCurrentRevision(); @@ -113,41 +114,48 @@ } // require 'view' access -function getPageContent($pagename,$credentials=false) { +function getPageContent($pagename, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); + checkCredentials($server, $credentials, 'view', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $rev = $page->getCurrentRevision(); $text = $rev->getPackedContent(); return $text; } + // require 'view' access -function getPageRevision($pagename,$revision,$credentials=false) { +function getPageRevision($pagename, $revision, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); + checkCredentials($server, $credentials, 'view', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $rev = $page->getCurrentRevision(); $text = $rev->getPackedContent(); return $text; } + // require 'view' access -function getCurrentRevision($pagename,$credentials=false) { +function getCurrentRevision($pagename, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); - if (!mayAccessPage ('view',$pagename)) - $server->fault(401,'',"no permission"); + checkCredentials($server, $credentials, 'view', $pagename); + if (!mayAccessPage('view', $pagename)) + $server->fault(401, '', "no permission"); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $rev = $page->getCurrentRevision(); $version = $current->getVersion(); return (double)$version; } + // require 'change' or 'view' access ? -function getPageMeta($pagename,$credentials=false) { +function getPageMeta($pagename, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); + checkCredentials($server, $credentials, 'view', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $rev = $page->getCurrentRevision(); @@ -155,10 +163,12 @@ //todo: reformat the meta hash return $meta; } + // require 'view' access to AllPages -function getAllPagenames($credentials=false) { +function getAllPagenames($credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("AllPages")); + checkCredentials($server, $credentials, 'view', _("AllPages")); $dbi = WikiDB::open($GLOBALS['DBParams']); $page_iter = $dbi->getAllPages(); $pages = array(); @@ -167,13 +177,15 @@ } return $pages; } + // require 'view' access -function getBacklinks($pagename,$credentials=false) { +function getBacklinks($pagename, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); + checkCredentials($server, $credentials, 'view', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $backend = &$dbi->_backend; - $result = $backend->get_links($pagename); + $result = $backend->get_links($pagename); $page_iter = new WikiDB_PageIterator($dbi, $result); $pages = array(); while ($page = $page_iter->next()) { @@ -181,10 +193,12 @@ } return $pages; } + // require 'view' access to TitleSearch -function doTitleSearch($s, $credentials=false) { +function doTitleSearch($s, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("TitleSearch")); + checkCredentials($server, $credentials, 'view', _("TitleSearch")); $dbi = WikiDB::open($GLOBALS['DBParams']); $query = new TextSearchQuery($s); $page_iter = $dbi->titleSearch($query); @@ -194,10 +208,12 @@ } return $pages; } + // require 'view' access to FullTextSearch -function doFullTextSearch($s, $credentials=false) { +function doFullTextSearch($s, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("FullTextSearch")); + checkCredentials($server, $credentials, 'view', _("FullTextSearch")); $dbi = WikiDB::open($GLOBALS['DBParams']); $query = new TextSearchQuery($s); $page_iter = $dbi->fullSearch($query); @@ -209,28 +225,31 @@ } // require 'view' access to RecentChanges -function getRecentChanges($limit=false, $since=false, $include_minor=false, $credentials=false) { +function getRecentChanges($limit = false, $since = false, $include_minor = false, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("RecentChanges")); + checkCredentials($server, $credentials, 'view', _("RecentChanges")); $dbi = WikiDB::open($GLOBALS['DBParams']); $params = array('limit' => $limit, 'since' => $since, - 'include_minor_revisions' => $include_minor); + 'include_minor_revisions' => $include_minor); $page_iter = $dbi->mostRecent($params); $pages = array(); while ($page = $page_iter->next()) { $pages[] = array('pagename' => $page->getName(), - 'lastModified' => $page->get('mtime'), - 'author' => $page->get('author'), - 'summary' => $page->get('summary'), // added with 1.3.13 - 'version' => $page->getVersion() - ); + 'lastModified' => $page->get('mtime'), + 'author' => $page->get('author'), + 'summary' => $page->get('summary'), // added with 1.3.13 + 'version' => $page->getVersion() + ); } return $pages; } + // require 'view' access -function listLinks($pagename, $credentials=false) { +function listLinks($pagename, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',$pagename); + checkCredentials($server, $credentials, 'view', $pagename); $dbi = WikiDB::open($GLOBALS['DBParams']); $page = $dbi->getPage($pagename); $linkiterator = $page->getPageLinks(); @@ -241,9 +260,11 @@ } return $links; } -function listPlugins($credentials=false) { + +function listPlugins($credentials = false) +{ global $server; - checkCredentials($server,$credentials,'change',_("HomePage")); + checkCredentials($server, $credentials, 'change', _("HomePage")); $plugin_dir = 'lib/plugin'; if (defined('PHPWIKI_DIR')) $plugin_dir = PHPWIKI_DIR . "/$plugin_dir"; @@ -266,9 +287,11 @@ } return $RetArray; } -function getPluginSynopsis($pluginname, $credentials=false) { + +function getPluginSynopsis($pluginname, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'change',"Help/".$pluginname."Plugin"); + checkCredentials($server, $credentials, 'change', "Help/" . $pluginname . "Plugin"); require_once 'lib/WikiPlugin.php'; $w = new WikiPluginLoader; $synopsis = ''; @@ -277,21 +300,24 @@ if (strtolower(substr(get_parent_class($p), 0, 10)) == 'wikiplugin') { $plugin_args = ''; $desc = $p->getArgumentsDescription(); - $src = array("\n",'"',"'",'|','[',']','\\'); - $replace = array('%0A','%22','%27','%7C','%5B','%5D','%5C'); - $desc = str_replace("<br />",' ',$desc->asXML()); + $src = array("\n", '"', "'", '|', '[', ']', '\\'); + $replace = array('%0A', '%22', '%27', '%7C', '%5B', '%5D', '%5C'); + $desc = str_replace("<br />", ' ', $desc->asXML()); if ($desc) - $plugin_args = '\n'.str_replace($src, $replace, $desc); - $synopsis = "<?plugin ".$pluginName.$plugin_args."?>"; // args? + $plugin_args = '\n' . str_replace($src, $replace, $desc); + $synopsis = "<?plugin " . $pluginName . $plugin_args . "?>"; // args? } return $synopsis; } + // only plugins returning pagelists will return something useful. so omit the html output -function callPlugin($pluginname, $pluginargs, $credentials=false) { +function callPlugin($pluginname, $pluginargs, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'change',"Help/".$pluginname."Plugin"); + checkCredentials($server, $credentials, 'change', "Help/" . $pluginname . "Plugin"); - $basepage = '';; + $basepage = ''; + ; require_once 'lib/WikiPlugin.php'; $w = new WikiPluginLoader; $p = $w->getPlugin($pluginName, false); // second arg? @@ -303,6 +329,7 @@ } return $pages; } + /** * array listRelations([ Integer option = 1 ]) * @@ -315,20 +342,23 @@ * * @author: Reini Urban */ -function listRelations($option = 1, $credentials=false) { +function listRelations($option = 1, $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("HomePage")); + checkCredentials($server, $credentials, 'view', _("HomePage")); $also_attributes = $option & 2; $only_attributes = $option & 2 and !($option & 1); $sorted = !($option & 4); return $dbh->listRelations($also_attributes, - $only_attributes, - $sorted); + $only_attributes, + $sorted); } + // some basic semantic search -function linkSearch($linktype, $search, $pages="*", $relation="*", $credentials=false) { +function linkSearch($linktype, $search, $pages = "*", $relation = "*", $credentials = false) +{ global $server; - checkCredentials($server,$credentials,'view',_("HomePage")); + checkCredentials($server, $credentials, 'view', _("HomePage")); $dbi = WikiDB::open($GLOBALS['DBParams']); require_once 'lib/TextSearchQuery.php'; $pagequery = new TextSearchQuery($pages); Modified: trunk/admin/wiki2public.php =================================================================== --- trunk/admin/wiki2public.php 2012-10-05 16:47:39 UTC (rev 8397) +++ trunk/admin/wiki2public.php 2012-10-06 10:28:33 UTC (rev 8398) @@ -1,4 +1,4 @@ <?php - // cronjob script to copy pages marked as "public" to a seperate public wiki area. - // If ENABLE_PAGE_PUBLIC = true - // can only run via localhost for security reasons +// cronjob script to copy pages marked as "public" to a seperate public wiki area. +// If ENABLE_PAGE_PUBLIC = true +// can only run via localhost for security reasons Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2012-10-05 16:47:39 UTC (rev 8397) +++ trunk/configurator.php 2012-10-06 10:28:33 UTC (rev 8398) @@ -54,17 +54,17 @@ */ global $HTTP_SERVER_VARS, $HTTP_POST_VARS, $tdwidth; -if (empty($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; -if (empty($_GET)) $_GET =& $GLOBALS['HTTP_GET_VARS']; -if (empty($_ENV)) $_ENV =& $GLOBALS['HTTP_ENV_VARS']; -if (empty($_POST)) $_POST =& $GLOBALS['HTTP_POST_VARS']; +if (empty($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; +if (empty($_GET)) $_GET =& $GLOBALS['HTTP_GET_VARS']; +if (empty($_ENV)) $_ENV =& $GLOBALS['HTTP_ENV_VARS']; +if (empty($_POST)) $_POST =& $GLOBALS['HTTP_POST_VARS']; if (empty($configurator)) $configurator = "configurator.php"; if (!strstr($_SERVER["SCRIPT_NAME"], $configurator) and defined('DATA_PATH')) $configurator = DATA_PATH . "/" . $configurator; $scriptname = str_replace('configurator.php', 'index.php', $_SERVER["SCRIPT_NAME"]); -if (strstr($_SERVER["SCRIPT_NAME"],"/php")) { // cgi got this different +if (strstr($_SERVER["SCRIPT_NAME"], "/php")) { // cgi got this different if (defined('DATA_PATH')) $scriptname = DATA_PATH . "/index.php"; else @@ -72,13 +72,14 @@ } $tdwidth = 700; -$config_file = (substr(PHP_OS,0,3) == 'WIN') ? 'config\\config.ini' : 'config/config.ini'; -$fs_config_file = dirname(__FILE__) . (substr(PHP_OS,0,3) == 'WIN' ? '\\' : '/') . $config_file; -if (isset($_POST['create'])) header('Location: '.$configurator.'?show=_part1&create=1#create'); +$config_file = (substr(PHP_OS, 0, 3) == 'WIN') ? 'config\\config.ini' : 'config/config.ini'; +$fs_config_file = dirname(__FILE__) . (substr(PHP_OS, 0, 3) == 'WIN' ? '\\' : '/') . $config_file; +if (isset($_POST['create'])) header('Location: ' . $configurator . '?show=_part1&create=1#create'); // helpers from lib/WikiUser/HttpAuth.php if (!function_exists('_http_user')) { - function _http_user() { + function _http_user() + { if (!isset($_SERVER)) $_SERVER = $GLOBALS['HTTP_SERVER_VARS']; if (!empty($_SERVER['PHP_AUTH_USER'])) @@ -87,7 +88,7 @@ return array($_SERVER['REMOTE_USER'], $_SERVER['PHP_AUTH_PW']); if (!empty($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'])) return array($GLOBALS['HTTP_ENV_VARS']['REMOTE_USER'], - $GLOBALS['HTTP_ENV_VARS']['PHP_AUTH_PW']); + $GLOBALS['HTTP_ENV_VARS']['PHP_AUTH_PW']); if (!empty($GLOBALS['REMOTE_USER'])) return array($GLOBALS['REMOTE_USER'], $GLOBALS['PHP_AUTH_PW']); @@ -96,14 +97,16 @@ list($userid, $passwd) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6))); return array($userid, $passwd); } - return array('',''); + return array('', ''); } - function _http_logout() { + + function _http_logout() + { if (!isset($_SERVER)) $_SERVER =& $GLOBALS['HTTP_SERVER_VARS']; // maybe we should random the realm to really force a logout. but the next login will fail. // better_srand(); $realm = microtime().rand(); - header('WWW-Authenticate: Basic realm="'.WIKI_NAME.'"'); + header('WWW-Authenticate: Basic realm="' . WIKI_NAME . '"'); if (strstr(php_sapi_name(), 'apache')) header('HTTP/1.0 401 Unauthorized'); else @@ -122,22 +125,21 @@ if (file_exists($fs_config_file)) { // Require admin user if (!defined('ADMIN_USER') or !defined('ADMIN_PASSWD')) { - if (!function_exists("IniConfig")) { - include_once 'lib/prepend.php'; + if (!function_exists("IniConfig")) { + include_once 'lib/prepend.php'; include_once 'lib/IniConfig.php'; - } + } IniConfig($fs_config_file); } if (!defined('ADMIN_USER') or ADMIN_USER == '') { trigger_error("Configuration problem:\nADMIN_USER not defined in \"$fs_config_file\".\n" - . "Cannot continue: You have to fix that manually.", E_USER_ERROR); + . "Cannot continue: You have to fix that manually.", E_USER_ERROR); exit(); } list($admin_user, $admin_pw) = _http_user(); //$required_user = ADMIN_USER; - if (empty($admin_user) or $admin_user != ADMIN_USER) - { + if (empty($admin_user) or $admin_user != ADMIN_USER) { _http_logout(); } // check password @@ -152,121 +154,167 @@ include_once 'lib/prepend.php'; include_once 'lib/IniConfig.php'; } - $def_file = (substr(PHP_OS,0,3) == 'WIN') ? 'config\\config-default.ini' : 'config/config-default.ini'; - $fs_def_file = dirname(__FILE__) . (substr(PHP_OS,0,3) == 'WIN' ? '\\' : '/') . $def_file; + $def_file = (substr(PHP_OS, 0, 3) == 'WIN') ? 'config\\config-default.ini' : 'config/config-default.ini'; + $fs_def_file = dirname(__FILE__) . (substr(PHP_OS, 0, 3) == 'WIN' ? '\\' : '/') . $def_file; IniConfig($fs_def_file); } -echo '<','?xml version="1.0" encoding="utf-8"?',">\n"; +echo '<', '?xml version="1.0" encoding="utf-8"?', ">\n"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> -<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<title>Configuration tool for PhpWiki <?php echo $config_file ?></title> -<style type="text/css" media="screen"> -<!-- -/* TABLE { border: thin solid black } */ -body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 80%; } -pre { font-size: 120%; } -td { border: thin solid black } -tr { border: none } -div.hint { background-color: #eeeeee; } -tr.hidden { border: none; display: none; } -td.part { background-color: #eeeeee; color: inherit; } -td.instructions { background-color: #ffffee; width: <?php echo $tdwidth ?>px; color: inherit; } -td.unchangeable-variable-top { border-bottom: none; background-color: #ffffee; color:inherit; } -td.unchangeable-variable-left { border-top: none; background-color: #ffffee; color:inherit; } ---> -</style> -<script type="text/javascript"> -<!-- -function update(accepted, error, value, output) { - var msg = document.getElementById(output); - if (accepted) { - /* MSIE 5.0 fails here */ - if (msg && msg.innerHTML) { msg.innerHTML = "<font color=\"green\">Input accepted.</font>"; } - } else { - while ((index = error.indexOf("%s")) > -1) { - error = error.substring(0, index) + value + error.substring(index+2); - } - if (msg) { msg.innerHTML = "<font color=\"red\">" + error + "</font>"; } - } - if (submit = document.getElementById('submit')) submit.disabled = accepted ? false : true; -} + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <title>Configuration tool for PhpWiki <?php echo $config_file ?></title> + <style type="text/css" media="screen"> + <!-- + /* TABLE { border: thin solid black } */ + body { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 80%; + } -function validate(error, value, output, field) { - update(field.value == value, error, field.value, output); -} + pre { + font-size: 120%; + } -function validate_ereg(error, ereg, output, field) { - regex = new RegExp(ereg); - update(regex.test(field.value), error, field.value, output); -} + td { + border: thin solid black + } -function validate_range(error, low, high, empty_ok, output, field) { - update((empty_ok == 1 && field.value == "") || - (field.value >= low && field.value <= high), - error, field.value, output); -} + tr { + border: none + } -function toggle_group(id) { - var text = document.getElementById(id + "_text"); - var do_hide = false; - if (text.innerHTML == "Hide options.") { - do_hide = true; - text.innerHTML = "Show options."; - } else { - text.innerHTML = "Hide options."; - } + div.hint { + background-color: #eeeeee; + } - var rows = document.getElementsByTagName('tr'); - var i = 0; - for (i = 0; i < rows.length; i++) { - var tr = rows[i]; - if (tr.className == 'header' && tr.id == id) { - i++; - break; - } - } - for (; i < rows.length; i++) { - var tr = rows[i]; - if (tr.className == 'header') - break; - tr.className = do_hide ? 'hidden': 'nonhidden'; - } -} + tr.hidden { + border: none; + display: none; + } -function do_init() { - // Hide all groups. We do this via JavaScript to avoid - // hiding the groups if JavaScript is not supported... - var rows = document.getElementsByTagName('tr'); - var show = '<?php echo $_GET["show"] ?>'; - for (var i = 0; i < rows.length; i++) { - var tr = rows[i]; - if (tr.className == 'header') - if (!show || tr.id != show) - toggle_group(tr.id); - } + td.part { + background-color: #eeeeee; + color: inherit; + } - // Select text in textarea upon focus - var area = document.getElementById('config-output'); - if (area) { - listener = { handleEvent: function (e) { area.select(); } }; - area.addEventListener('focus', listener, false); - } -} + td.instructions { + background-color: #ffffee; + width: <?php echo $tdwidth ?>px; + color: inherit; + } ---> -</script> + td.unchangeable-variable-top { + border-bottom: none; + background-color: #ffffee; + color: inherit; + } + + td.unchangeable-variable-left { + border-top: none; + background-color: #ffffee; + color: inherit; + } + + --> + </style> + <script type="text/javascript"> + < + !-- + function update(accepted, error, value, output) { + var msg = document.getElementById(output); + if (accepted) { + /* MSIE 5.0 fails here */ + if (msg && msg.innerHTML) { + msg.innerHTML = "<font color=\"green\">Input accepted.</font>"; + } + } else { + while ((index = error.indexOf("%s")) > -1) { + error = error.substring(0, index) + value + error.substring(index + 2); + } + if (msg) { + msg.innerHTML = "<font color=\"red\">" + error + "</font>"; + } + } + if (submit = document.getElementById('submit')) submit.disabled = accepted ? false : true; + } + + function validate(error, value, output, field) { + update(field.value == value, error, field.value, output); + } + + function validate_ereg(error, ereg, output, field) { + regex = new RegExp(ereg); + update(regex.test(field.value), error, field.value, output); + } + + function validate_range(error, low, high, empty_ok, output, field) { + update((empty_ok == 1 && field.value == "") || + (field.value >= low && field.value <= high), + error, field.value, output); + } + + function toggle_group(id) { + var text = document.getElementById(id + "_text"); + var do_hide = false; + if (text.innerHTML == "Hide options.") { + do_hide = true; + text.innerHTML = "Show options."; + } else { + text.innerHTML = "Hide options."; + } + + var rows = document.getElementsByTagName('tr'); + var i = 0; + for (i = 0; i < rows.length; i++) { + var tr = rows[i]; + if (tr.className == 'header' && tr.id == id) { + i++; + break; + } + } + for (; i < rows.length; i++) { + var tr = rows[i]; + if (tr.className == 'header') + break; + tr.className = do_hide ? 'hidden' : 'nonhidden'; + } + } + + function do_init() { + // Hide all groups. We do this via JavaScript to avoid + // hiding the groups if JavaScript is not supported... + var rows = document.getElementsByTagName('tr'); + var show = '<?php echo $_GET["show"] ?>'; + for (var i = 0; i < rows.length; i++) { + var tr = rows[i]; + if (tr.className == 'header') + if (!show || tr.id != show) + toggle_group(tr.id); + } + + // Select text in textarea upon focus + var area = document.getElementById('config-output'); + if (area) { + listener = { handleEvent:function (e) { + area.select(); + } }; + area.addEventListener('focus', listener, false); + } + } + + -- > + </script> </head> <body onload="do_init();"> - <h1>Configuration for PhpWiki <?php echo $config_file ?></h1> +<h1>Configuration for PhpWiki <?php echo $config_file ?></h1> <div class="hint"> - Using this configurator.php is experimental!<br /> + Using this configurator.php is experimental!<br/> On any configuration problems, please edit the resulting config.ini manually. </div> @@ -330,121 +378,121 @@ // grep \'$x\' configurator.php >/dev/null || echo $x ; done $properties["Part Zero"] = -new part('_part0', $SEPARATOR."\n", " + new part('_part0', $SEPARATOR . "\n", " Part Zero: (optional) Latest Development and Tricky Options"); if (defined('INCLUDE_PATH')) $include_path = INCLUDE_PATH; else { - if (substr(PHP_OS,0,3) == 'WIN') { - $include_path = dirname(__FILE__) . ';' . ini_get('include_path'); - if (strchr(ini_get('include_path'),'/')) - $include_path = strtr($include_path,'\\','/'); - } else { - $include_path = dirname(__FILE__) . ':' . ini_get('include_path'); - } + if (substr(PHP_OS, 0, 3) == 'WIN') { + $include_path = dirname(__FILE__) . ';' . ini_get('include_path'); + if (strchr(ini_get('include_path'), '/')) + $include_path = strtr($include_path, '\\', '/'); + } else { + $include_path = dirname(__FILE__) . ':' . ini_get('include_path'); + } } $properties["PHP include_path"] = -new _define('INCLUDE_PATH', $include_path); + new _define('INCLUDE_PATH', $include_path); // TODO: Convert this to a checkbox row as in tests/unit/test.php $properties["DEBUG"] = -new numeric_define_optional('DEBUG', DEBUG); + new numeric_define_optional('DEBUG', DEBUG); $properties["ENABLE_EDIT_TOOLBAR"] = -new boolean_define_commented_optional('ENABLE_EDIT_TOOLBAR'); + new boolean_define_commented_optional('ENABLE_EDIT_TOOLBAR'); $properties["JS_SEARCHREPLACE"] = -new boolean_define_commented_optional('JS_SEARCHREPLACE'); + new boolean_define_commented_optional('JS_SEARCHREPLACE'); // TESTME: use config-default: = false $properties["ENABLE_DOUBLECLICKEDIT"] = -new boolean_define_commented_optional('ENABLE_DOUBLECLICKEDIT'); + new boolean_define_commented_optional('ENABLE_DOUBLECLICKEDIT'); $properties["ENABLE_WYSIWYG"] = -new boolean_define_commented_optional('ENABLE_WYSIWYG'); + new boolean_define_commented_optional('ENABLE_WYSIWYG'); $properties["WYSIWYG_BACKEND"] = -new _define_selection( -'WYSIWYG_BACKEND', -array('Wikiwyg' => 'Wikiwyg', - 'tinymce' => 'tinymce', - 'FCKeditor' => 'FCKeditor', - 'spaw' => 'spaw', - 'htmlarea3' => 'htmlarea3', - 'htmlarea2' => 'htmlarea2', -)); + new _define_selection( + 'WYSIWYG_BACKEND', + array('Wikiwyg' => 'Wikiwyg', + 'tinymce' => 'tinymce', + 'FCKeditor' => 'FCKeditor', + 'spaw' => 'spaw', + 'htmlarea3' => 'htmlarea3', + 'htmlarea2' => 'htmlarea2', + )); $properties["WYSIWYG_DEFAULT_PAGETYPE_HTML"] = -new boolean_define_commented_optional('WYSIWYG_DEFAULT_PAGETYPE_HTML'); + new boolean_define_commented_optional('WYSIWYG_DEFAULT_PAGETYPE_HTML'); $properties["UPLOAD_USERDIR"] = -new boolean_define_commented_optional('UPLOAD_USERDIR'); + new boolean_define_commented_optional('UPLOAD_USERDIR'); $properties["DISABLE_UNITS"] = -new boolean_define_commented_optional('DISABLE_UNITS'); + new boolean_define_commented_optional('DISABLE_UNITS'); $properties["UNITS_EXE"] = -new _define_commented_optional('UNITS_EXE'); + new _define_commented_optional('UNITS_EXE'); $properties["ENABLE_XHTML_XML"] = -new boolean_define_commented_optional('ENABLE_XHTML_XML'); + new boolean_define_commented_optional('ENABLE_XHTML_XML'); $properties["ENABLE_OPEN_GRAPH"] = -new boolean_define_commented_optional('ENABLE_OPEN_GRAPH'); + new boolean_define_commented_optional('ENABLE_OPEN_GRAPH'); $properties["ENABLE_SPAMASSASSIN"] = -new boolean_define_commented_optional('ENABLE_SPAMASSASSIN'); + new boolean_define_commented_optional('ENABLE_SPAMASSASSIN'); $properties["ENABLE_SPAMBLOCKLIST"] = -new boolean_define_optional('ENABLE_SPAMBLOCKLIST'); + new boolean_define_optional('ENABLE_SPAMBLOCKLIST'); $properties["NUM_SPAM_LINKS"] = -new numeric_define_optional('NUM_SPAM_LINKS'); + new numeric_define_optional('NUM_SPAM_LINKS'); $properties["GOOGLE_LINKS_NOFOLLOW"] = -new boolean_define_commented_optional('GOOGLE_LINKS_NOFOLLOW'); + new boolean_define_commented_optional('GOOGLE_LINKS_NOFOLLOW'); $properties["ENABLE_LIVESEARCH"] = -new boolean_define_commented_optional('ENABLE_LIVESEARCH'); + new boolean_define_commented_optional('ENABLE_LIVESEARCH'); $properties["ENABLE_ACDROPDOWN"] = -new boolean_define_commented_optional('ENABLE_ACDROPDOWN'); + new boolean_define_commented_optional('ENABLE_ACDROPDOWN'); $properties["ENABLE_DISCUSSION_LINK"] = -new boolean_define_commented_optional('ENABLE_DISCUSSION_LINK'); + new boolean_define_commented_optional('ENABLE_DISCUSSION_LINK'); $properties["ENABLE_CAPTCHA"] = -new boolean_define_commented_optional('ENABLE_CAPTCHA'); + new boolean_define_commented_optional('ENABLE_CAPTCHA'); $properties["USE_CAPTCHA_RANDOM_WORD"] = -new boolean_define_commented_optional('USE_CAPTCHA_RANDOM_WORD'); + new boolean_define_commented_optional('USE_CAPTCHA_RANDOM_WORD'); $properties["USE_SAFE_DBSESSION"] = -new boolean_define_commented_optional('USE_SAFE_DBSESSION'); + new boolean_define_commented_optional('USE_SAFE_DBSESSION'); $properties["BLOG_DEFAULT_EMPTY_PREFIX"] = -new boolean_define_commented_optional('BLOG_DEFAULT_EMPTY_PREFIX'); + new boolean_define_commented_optional('BLOG_DEFAULT_EMPTY_PREFIX'); $properties["ENABLE_SEARCHHIGHLIGHT"] = -new boolean_define_commented_optional('ENABLE_SEARCHHIGHLIGHT'); + new boolean_define_commented_optional('ENABLE_SEARCHHIGHLIGHT'); $properties["Part One"] = -new part('_part1', $SEPARATOR."\n", " + new part('_part1', $SEPARATOR . "\n", " Part One: Authentication and security settings. See Part Three for more."); $properties["Wiki Name"] = -new _define_optional('WIKI_NAME', WIKI_NAME); + new _define_optional('WIKI_NAME', WIKI_NAME); $properties["Admin Username"] = -new _define_notempty('ADMIN_USER', ADMIN_USER, " + new _define_notempty('ADMIN_USER', ADMIN_USER, " You must set this! Username and password of the administrator.", -"onchange=\"validate_ereg('Sorry, ADMIN_USER cannot be empty.', '^.+$', 'ADMIN_USER', this);\""); + "onchange=\"validate_ereg('Sorry, ADMIN_USER cannot be empty.', '^.+$', 'ADMIN_USER', this);\""); $properties["Admin Password"] = -new _define_password('ADMIN_PASSWD', ADMIN_PASSWD, " + new _define_password('ADMIN_PASSWD', ADMIN_PASSWD, " You must set this! For heaven's sake pick a good password. @@ -453,74 +501,74 @@ Use the \"Create Random Password\" button to create a good (random) password. ADMIN_PASSWD is ignored on HttpAuth", -"onchange=\"validate_ereg('Sorry, ADMIN_PASSWD must be at least 4 chars long.', '^....+$', 'ADMIN_PASSWD', this);\""); + "onchange=\"validate_ereg('Sorry, ADMIN_PASSWD must be at least 4 chars long.', '^....+$', 'ADMIN_PASSWD', this);\""); $properties["Encrypted Passwords"] = -new boolean_define -('ENCRYPTED_PASSWD', - array('true' => "true. use crypt for all passwords", - 'false' => "false. use plaintest passwords (not recommended)")); + new boolean_define + ('ENCRYPTED_PASSWD', + array('true' => "true. use crypt for all passwords", + 'false' => "false. use plaintest passwords (not recommended)")); $properties["Reverse DNS"] = -new boolean_define_optional -('ENABLE_REVERSE_DNS', - array('true' => "true. perform additional reverse dns lookups", - 'false' => "false. just record the address as given by the httpd server")); + new boolean_define_optional + ('ENABLE_REVERSE_DNS', + array('true' => "true. perform additional reverse dns lookups", + 'false' => "false. just record the address as given by the httpd server")); $properties["ZIP Dump Authentication"] = -new boolean_define_optional('ZIPDUMP_AUTH', - array('false' => "false. Everyone may download zip dumps", - 'true' => "true. Only admin may download zip dumps")); + new boolean_define_optional('ZIPDUMP_AUTH', + array('false' => "false. Everyone may download zip dumps", + 'true' => "true. Only admin may download zip dumps")); $properties["Enable RawHtml Plugin"] = -new boolean_define_commented_optional('ENABLE_RAW_HTML'); + new boolean_define_commented_optional('ENABLE_RAW_HTML'); $properties["Allow RawHtml Plugin only on locked pages"] = -new boolean_define_commented_optional('ENABLE_RAW_HTML_LOCKEDONLY'); + new boolean_define_commented_optional('ENABLE_RAW_HTML_LOCKEDONLY'); $properties["Allow RawHtml Plugin if safe HTML code"] = - new boolean_define_commented_optional('ENABLE_RAW_HTML_SAFE','', " + new boolean_define_commented_optional('ENABLE_RAW_HTML_SAFE', '', " If this is set, all unsafe html code is stripped automatically (experimental!) See <a href=\"http://chxo.com/scripts/safe_html-test.php\" target=\"_new\">chxo.com/scripts/safe_html-test.php</a> "); $properties["Maximum Upload Size"] = -new numeric_define_optional('MAX_UPLOAD_SIZE', MAX_UPLOAD_SIZE); + new numeric_define_optional('MAX_UPLOAD_SIZE', MAX_UPLOAD_SIZE); $properties["Minor Edit Timeout"] = -new numeric_define_optional('MINOR_EDIT_TIMEOUT', MINOR_EDIT_TIMEOUT); + new numeric_define_optional('MINOR_EDIT_TIMEOUT', MINOR_EDIT_TIMEOUT); $properties["Disabled Actions"] = -new array_define('DISABLED_ACTIONS', DISABLED_ACTIONS /*array()*/); + new array_define('DISABLED_ACTIONS', DISABLED_ACTIONS /*array()*/); $properties["Moderate all Pagechanges"] = -new boolean_define_commented_optional('ENABLE_MODERATEDPAGE_ALL'); + new boolean_define_commented_optional('ENABLE_MODERATEDPAGE_ALL'); $properties["Access Log File"] = -new _define_commented_optional('ACCESS_LOG', ACCESS_LOG); + new _define_commented_optional('ACCESS_LOG', ACCESS_LOG); $properties["Access Log SQL"] = -new _define_selection( -'ACCESS_LOG_SQL', -array('0' => 'disabled', - '1' => 'read only', - '2' => 'read + write')); + new _define_selection( + 'ACCESS_LOG_SQL', + array('0' => 'disabled', + '1' => 'read only', + '2' => 'read + write')); $properties["Compress Output"] = -new boolean_define_commented_optional -( 'COMPRESS_OUTPUT', - array('' => 'undefined - GZIP compress when appropriate.', - 'false' => 'Never compress output.', - 'true' => 'Always try to compress output.')); + new boolean_define_commented_optional + ('COMPRESS_OUTPUT', + array('' => 'undefined - GZIP compress when appropriate.', + 'false' => 'Never compress output.', + 'true' => 'Always try to compress output.')); $properties["HTTP Cache Control"] = -new _define_selection_optional -('CACHE_CONTROL', - array('LOOSE' => 'LOOSE', - 'STRICT' => 'STRICT', - 'NO_CACHE' => 'NO_CACHE', - 'ALLOW_STALE' => 'ALLOW_STALE'), -" + new _define_selection_optional + ('CACHE_CONTROL', + array('LOOSE' => 'LOOSE', + 'STRICT' => 'STRICT', + 'NO_CACHE' => 'NO_CACHE', + 'ALLOW_STALE' => 'ALLOW_STALE'), + " HTTP CACHE_CONTROL This controls how PhpWiki sets the HTTP cache control @@ -559,46 +607,46 @@ The default is currently LOOSE."); $properties["HTTP Cache Control Max Age"] = -new numeric_define_optional('CACHE_CONTROL_MAX_AGE', CACHE_CONTROL_MAX_AGE); + new numeric_define_optional('CACHE_CONTROL_MAX_AGE', CACHE_CONTROL_MAX_AGE); $properties["Markup Caching"] = -new boolean_define_commented_optional -('WIKIDB_NOCACHE_MARKUP', - array('false' => 'Enable markup cache', - 'true' => 'Disable markup cache')); + new boolean_define_commented_optional + ('WIKIDB_NOCACHE_MARKUP', + array('false' => 'Enable markup cache', + 'true' => 'Disable markup cache')); $properties["COOKIE_EXPIRATION_DAYS"] = -new numeric_define_optional('COOKIE_EXPIRATION_DAYS', COOKIE_EXPIRATION_DAYS); + new numeric_define_optional('COOKIE_EXPIRATION_DAYS', COOKIE_EXPIRATION_DAYS); $properties["COOKIE_DOMAIN"] = -new _define_commented_optional('COOKIE_DOMAIN', COOKIE_DOMAIN); + new _define_commented_optional('COOKIE_DOMAIN', COOKIE_DOMAIN); $properties["Path for PHP Session Support"] = -new _define_optional('SESSION_SAVE_PATH', defined('SESSION_SAVE_PATH') ? SESSION_SAVE_PATH : ini_get('session.save_path')); + new _define_optional('SESSION_SAVE_PATH', defined('SESSION_SAVE_PATH') ? SESSION_SAVE_PATH : ini_get('session.save_path')); $properties["Force PHP Database Sessions"] = -new boolean_define_commented_optional -('USE_DB_SESSION', - array('false' => 'Disable database sessions, use files', - 'true' => 'Enable database sessions')); + new boolean_define_commented_optional + ('USE_DB_SESSION', + array('false' => 'Disable database sessions, use files', + 'true' => 'Enable database sessions')); ///////// database selection $properties["Part Two"] = -new part('_part2', $SEPARATOR."\n", " + new part('_part2', $SEPARATOR . "\n", " Part Two: Database Configuration "); $properties["Database Type"] = -new _define_selection("DATABASE_TYPE", - array('dba' => "dba", - 'SQL' => "SQL PEAR", - 'ADODB' => "SQL ADODB", - 'PDO' => "PDO (php5 only)", - 'file' => "flatfile", - 'cvs' => "CVS File handler")/*, " + new _define_selection("DATABASE_TYPE", + array('dba' => "dba", + 'SQL' => "SQL PEAR", + 'ADODB' => "SQL ADODB", + 'PDO' => "PDO (php5 only)", + 'file' => "flatfile", + 'cvs' => "CVS File handler")/*, " Select the database backend type: Choose dba (default) to use one of the standard UNIX dba libraries. This is the fastest. Choose ADODB or SQL to use an SQL database with ADODB or PEAR. @@ -608,7 +656,7 @@ Recommended is dba or SQL: PEAR or ADODB."*/); $properties["SQL DSN Setup"] = -new unchangeable_variable('_sqldsnstuff', "", " + new unchangeable_variable('_sqldsnstuff', "", " For SQL based backends, specify the database as a DSN The most general form of a DSN looks like: <pre> @@ -632,30 +680,30 @@ // Choose dba to use one of the standard UNIX dbm libraries. $properties["SQL Type"] = -new _variable_selection('_dsn_sqltype', - array('mysql' => "MySQL", - 'pgsql' => "PostgreSQL", - 'mssql' => "Microsoft SQL Server", - 'mssqlnative' => "Microsoft SQL Server (native)", - 'oci8' => "Oracle 8", - 'mysqli' => "mysqli (only ADODB)", - 'mysqlt' => "mysqlt (only ADODB)", - 'ODBC' => "ODBC (only ADODB or PDO)", - 'firebird' => "Firebird (only PDO)", - 'oracle' => "Oracle (only PDO)", -), " + new _variable_selection('_dsn_sqltype', + array('mysql' => "MySQL", + 'pgsql' => "PostgreSQL", + 'mssql' => "Microsoft SQL Server", + 'mssqlnative' => "Microsoft SQL Server (native)", + 'oci8' => "Oracle 8", + 'mysqli' => "mysqli (only ADODB)", + 'mysqlt' => "mysqlt (only ADODB)", + 'ODBC' => "ODBC (only ADODB or PDO)", + 'firebird' => "Firebird (only PDO)", + 'oracle' => "Oracle (only PDO)", + ), " SQL DB types. The DSN hosttype."); $properties["SQL User"] = -new _variable('_dsn_sqluser', "wikiuser", " + new _variable('_dsn_sqluser', "wikiuser", " SQL User Id:"); $properties["SQL Password"] = -new _variable('_dsn_sqlpass', "", " + new _variable('_dsn_sqlpass', "", " SQL Password:"); $properties["SQL Database Host"] = -new _variable('_dsn_sqlhostorsock', "localhost", " + new _variable('_dsn_sqlhostorsock', "localhost", " SQL Database Hostname: To connect ov... [truncated message content] |