[Phpcms-plugins-cvs] admin4phpCMS/modules/phpcms module_phpcms_en.lng,1.1,1.2 module_phpcms_de.lng,1
Brought to you by:
mjahn
From: Martin J. <mj...@us...> - 2005-04-15 15:20:16
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20482/modules/phpcms Modified Files: module_phpcms_en.lng module_phpcms_de.lng class.module_phpcms.php Log Message: Commit as backup during development Index: module_phpcms_en.lng =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/module_phpcms_en.lng,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- module_phpcms_en.lng 7 Apr 2005 14:09:08 -0000 1.1 +++ module_phpcms_en.lng 15 Apr 2005 15:20:05 -0000 1.2 @@ -1,7 +1,9 @@ PHPCMS_1 = "phpCMS — Configuration" PHPCMS_2 = "phpCMS — Cache" -PHPCMS_3 = "phpCMS — HTTP-Indexer!" -PHPCMS_4 = "<h2>Welcome to phpCMS!</h2> +PHPCMS_3 = "phpCMS — HTTP-Indexer" +PHPCMS_4 = "phpCMS — Server-Info" +PHPCMS_5 = "phpCMS — PHP-Info" +PHPCMS_6 = "<h2>Welcome to phpCMS!</h2> <p>Thank you for installing phpCMS</p> <p> @@ -33,17 +35,25 @@ PHPCMS_INDEXER_19 = "Search with the following expression …" PHPCMS_INDEXER_20 = "… and replace it with the following text" PHPCMS_INDEXER_21 = "Select profile" +PHPCMS_INDEXER_21a = "Select action" PHPCMS_INDEXER_22 = "Create a new index for this profile" +PHPCMS_INDEXER_22a = "Index" PHPCMS_INDEXER_23 = "Edit the settings of this profile" +PHPCMS_INDEXER_23a = "Edit" PHPCMS_INDEXER_24 = "Delete this profile" +PHPCMS_INDEXER_24a = "Delete" PHPCMS_INDEXER_25 = "Test the index with a searchform" PHPCMS_INDEXER_26 = "Test index" PHPCMS_INDEXER_27 = "Show the most important 10,20 50 words of the index" PHPCMS_INDEXER_28 = "Show wordlist" PHPCMS_INDEXER_29 = "Please create an index first" PHPCMS_INDEXER_30 = "No current index available" -PHPCMS_IDNEXER_31 = "Save profile" +PHPCMS_INDEXER_31 = "Save settings" PHPCMS_INDEXER_32 = "Save settings" +PHPCMS_INDEXER_33 = "List profiles" +PHPCMS_INDEXER_34 = "Create a new profile" +PHPCMS_INDEXER_34a = "Create a new profile" +PHPCMS_INDEXER_34b = "New profile" PHPCMS_CACHE_1 = "Filename" PHPCMS_CACHE_2 = "Last changes" Index: class.module_phpcms.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/class.module_phpcms.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- class.module_phpcms.php 7 Apr 2005 14:09:08 -0000 1.7 +++ class.module_phpcms.php 15 Apr 2005 15:20:05 -0000 1.8 @@ -28,7 +28,7 @@ /* * $Log$ -* Revision 1.7 2005/04/07 14:09:08 mjahn +* Revision 1.8 2005/04/15 15:20:05 mjahn * Commit as backup during development * */ @@ -184,6 +184,24 @@ if (!is_dir($this->cachedir)) { return false; } + + $dyn_ext = substr ($this->_DEFAULTS ['DYN_EXTENSION']['value'], 1, 200); + $stat_ext = substr ($this->_DEFAULTS ['PAGE_EXTENSION']['value'], 1, 200); + + if ($this->_USER ['username'] != 'demo') { + // delete cache-entry if allowed and wished + if (trim ($this->_cacheaction) == 'del-sel-cache') { + foreach ($this->_formdata as $id=>$value) { + if (substr ($id, 0, 7) != 'delete-') { + continue; + } + $id = substr ($id, 7, strlen ($id)); + $id = str_replace (array ('_'.$dyn_ext, '_gz', '_'.$stat_ext), array ('.'.$dyn_ext, '.gz', '.'.$stat_ext), $id); + $this->_delCacheEntry ($id); + } + + } + } $this->_CACHE = array (); @@ -286,6 +304,18 @@ $_data [] = $data1; + $data1 = array ('name' => 'Server-Info', 'module' => 'phpcms', 'action' => 'serverinfo'); + if ($this->action == 'serverinfo') { + $data1 ['extra'] = 'class="current"'; + } + $_data [] = $data1; + + $data1 = array ('name' => 'PHPinfo', 'module' => 'phpcms', 'action' => 'phpinfo'); + if ($this->action == 'phpinfo') { + $data1 ['extra'] = 'class="current"'; + } + $_data [] = $data1; + $data ['_sub_'] = $_data; } @@ -301,6 +331,8 @@ * @param array $actiondata $actiondata['_root'] must provide the id of the parental element **/ function getData(&$actiondata) { + global $GLOBALS; + if (!$this->_USER['isLoggedIn']) { return true; } @@ -309,7 +341,7 @@ return true; } - $data = array ('action'=>$this->action); + $data = array ('action'=>$this->action, 'session'=>$_SESSION); $data ['version'] = $this->_DEFAULTS ['VERSION']; switch ($this->action) { @@ -364,6 +396,74 @@ } $data ['indexeraction'] = $this->_indexerAction; break; + case 'serverinfo': + $temp = get_loaded_extensions (); + $data ['phpModules'] = array (); + foreach ($temp as $name) { + $data ['phpModules'] [] = array ('name'=>$name, 'desc'=>$name); + } + $data ['phpIniValues'] = ini_get_all (); + + // BOF Fix phpinfo + ob_start(); + phpinfo(); + $infobuffer .= ob_get_contents(); + ob_end_clean(); + + preg_match_all("=<body[^>]*>(.*)</body>=siU", $infobuffer, $a); + $phpinfo = $a[1][0]; + $phpinfo = str_replace( ';','; ', $phpinfo ); + $phpinfo = str_replace( ',',', ', $phpinfo ); + $phpinfo = str_replace( '<br>','<br />', $phpinfo ); + $phpinfo = str_replace( 'align="center"','', $phpinfo ); + $phpinfo = str_replace( 'align="right"','', $phpinfo ); + + $data ['phpInfo'] = $phpinfo; + + $temp = array ( + 'GLOBALS', + 'HTTP_SERVER_VARS', + '_SERVER', + 'HTTP_ENV_VARS', + '_ENV', + 'HTTP_SESSION_VARS', + '_SESSION', +/* 'HTTP_GET_VARS', + '_GET', + 'HTTP_POST_VARS', + '_POST', + 'HTTP_POST_FILES', + '_FILES', +*/ 'HTTP_COOKIE_VARS', + '_COOKIE', + '_REQUEST' + ); + + $data ['serverVars'] = array (); + foreach ($temp as $varname) { + if (!isset ($GLOBALS [$varname])) { + continue; + } + $data ['serverVars'] [$varname] = $GLOBALS [$varname]; + } + break; + case 'phpinfo': + // BOF Fix phpinfo + ob_start(); + phpinfo(); + $infobuffer .= ob_get_contents(); + ob_end_clean(); + + preg_match_all("=<body[^>]*>(.*)</body>=siU", $infobuffer, $a); + $phpinfo = $a[1][0]; + $phpinfo = str_replace( ';','; ', $phpinfo ); + $phpinfo = str_replace( ',',', ', $phpinfo ); + $phpinfo = str_replace( '<br>','<br />', $phpinfo ); + $phpinfo = str_replace( 'align="center"','align="left"', $phpinfo ); + $phpinfo = str_replace( 'align="right"','align="left"', $phpinfo ); + + $data ['phpinfo'] = $phpinfo; + default: break; } @@ -379,7 +479,6 @@ // function getData () function getLanguageData (&$actiondata) { - $langAvailable = array ('de', 'en'); $data = $actiondata [$actiondata ['tag']]; @@ -593,6 +692,16 @@ return strcmp($a, $b); } // function sortCacheList () + + function _delCacheEntry ($id) { + $id = $this->cachedir.'/'.strip_tags ($id); + if (!file_exists ($id) || !is_writable (dirname ($id))) { + echo '-1'.$id; + return false; + } + unlink ($id); + return true; + } /** * get list of subdirectories with write-permission for PHP @@ -683,6 +792,7 @@ $this->_indexerProfiles = unserialize (trim (implode ($data))); foreach ($this->_indexerProfiles as $id=>$profile) { + // check for search indexfiles $_datafile = $this->docroot.'/'.$profile ['savedata'].'/words.'; if ($profile ['gzip'] == 1) { $_datafile .= 'gz'; @@ -693,7 +803,22 @@ if (!file_exists ($_datafile) || !is_readable ($_datafile)) { $this->_indexerProfiles [$id] ['indexAvailable'] = 0; } - } + + // resample URL-replacement + $temp = array (); + if (is_array ($profile ['url_pattern']) && count ($profile ['url_pattern']) > 0) { + for ($i = 0; $i < count ($profile ['url_pattern']); $i++) { + if (isset ($profile->url_replacement [$i])) { + $temp [] = array ('search'=>$profile ['url_pattern'] [$i], 'replace'=>$profile ['url_replacement'] [$i]); + } else { + $temp [] = array ('search'=>$profile ['url_pattern'] [$i], 'replace'=>''); + } + } + } + $this->_indexerProfiles [$id] ['url_regex'] = $temp; + } + //print_r ($this->_indexerProfiles); + return true; } function _parseIndexerFormdata () { @@ -713,7 +838,7 @@ } function _ffilesize ($size) { - $factor = 0; +/* $factor = 0; while ($size > 1024) { $factor++; $size /= 1024; @@ -726,6 +851,8 @@ } return round ($size / $factor); + */ + return $size; } } ?> \ No newline at end of file Index: module_phpcms_de.lng =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/phpcms/module_phpcms_de.lng,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- module_phpcms_de.lng 7 Apr 2005 14:09:08 -0000 1.1 +++ module_phpcms_de.lng 15 Apr 2005 15:20:05 -0000 1.2 @@ -1,7 +1,9 @@ PHPCMS_1 = "phpCMS — Konfiguration" PHPCMS_2 = "phpCMS — Cache" PHPCMS_3 = "phpCMS — HTTP-Indexer!" -PHPCMS_4 = "<h2>Willkommen bei phpCMS!</h2> +PHPCMS_4 = "phpCMS — Server-Info" +PHPCMS_5 = "phpCMS — PHP-Info" +PHPCMS_6 = "<h2>Willkommen bei phpCMS!</h2> <p>Vielen Dank, daß Sie phpCMS installiert haben</p> <p> @@ -30,18 +32,26 @@ PHPCMS_INDEXER_18 = "Ändere URLs" PHPCMS_INDEXER_19 = "Suche nach …" PHPCMS_INDEXER_20 = "… und ersetze mit" -PHPCMS_INDEXER_21 = "Profil auswählen" +PHPCMS_INDEXER_21 = "Profil wählen" +PHPCMS_INDEXER_21a = "Aktion wählen" PHPCMS_INDEXER_22 = "Erstelle einen neuen Index für dieses Profile" +PHPCMS_INDEXER_22a = "Indizieren" PHPCMS_INDEXER_23 = "Editiere die Einstellungen dieses Profiles" +PHPCMS_INDEXER_23a = "Ãndern" PHPCMS_INDEXER_24 = "Lösche dieses Profil" +PHPCMS_INDEXER_24a = "Löschen" PHPCMS_INDEXER_25 = "Suche testen" PHPCMS_INDEXER_26 = "Suche testen" PHPCMS_INDEXER_27 = "Zeige die am häufigsten aufgetretenen Worte in diesem Index" PHPCMS_INDEXER_28 = "Wortliste" PHPCMS_INDEXER_29 = "Bitte erstellen Sie zuerst einen neuen Index" PHPCMS_INDEXER_30 = "Kein aktueller Index verfügbar" -PHPCMS_INDEXER_31 = "Profil speichern" +PHPCMS_INDEXER_31 = "Einstellungen speichern" PHPCMS_INDEXER_32 = "Einstellungen speichern" +PHPCMS_INDEXER_33 = "Profilübersicht" +PHPCMS_INDEXER_34 = "Neues Profil erstellen" +PHPCMS_INDEXER_34a = "Neues Profil erstellen" +PHPCMS_INDEXER_34b = "Neues Profil" PHPCMS_CACHE_1 = "Dateiname" PHPCMS_CACHE_2 = "Letzte Änderungen" |