[Phpfreechat-svn] SF.net SVN: phpfreechat: [464] trunk
Status: Beta
Brought to you by:
kerphi
From: <ne...@us...> - 2006-04-24 14:40:37
|
Revision: 464 Author: nemako Date: 2006-04-24 07:40:06 -0700 (Mon, 24 Apr 2006) ViewCVS: http://svn.sourceforge.net/phpfreechat/?rev=464&view=rev Log Message: ----------- Add the administration interface + admin folder with users access, version and themes management + change in src/pfci18n.class.php to support the admin parameter + add admin.php files in the i18n folder for en_US and fr_FR + add info.php description file in themes folder Modified Paths: -------------- trunk/src/pfci18n.class.php Added Paths: ----------- trunk/admin/ trunk/admin/configuration.php trunk/admin/htaccess.class.php trunk/admin/inc.conf.php trunk/admin/index.php trunk/admin/index_html_bottom.php trunk/admin/index_html_top.php trunk/admin/style/ trunk/admin/style/bulle.png trunk/admin/style/check_off.png trunk/admin/style/check_on.png trunk/admin/style/content.css trunk/admin/style/footer.css trunk/admin/style/generic.css trunk/admin/style/header.css trunk/admin/style/logo_88x31.gif trunk/admin/style/menu.css trunk/admin/style/show.js trunk/admin/style/valid-css.png trunk/admin/style/valid-xhtml.png trunk/admin/themes.class.php trunk/admin/themes.php trunk/admin/themes_avant.php trunk/admin/user.php trunk/admin/version.class.php trunk/i18n/en_US/admin.php trunk/i18n/fr_FR/admin.php trunk/themes/blune/info.php trunk/themes/cerutti/info.php trunk/themes/default/info.php Added: trunk/admin/configuration.php =================================================================== --- trunk/admin/configuration.php (rev 0) +++ trunk/admin/configuration.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,14 @@ +<? +// TOP // +include("index_html_top.php"); +?> + +<div class="content"> + <h2>Configuration</h2> + +</div> + +<? +// BOTTOM +include("index_html_bottom.php"); +?> \ No newline at end of file Added: trunk/admin/htaccess.class.php =================================================================== --- trunk/admin/htaccess.class.php (rev 0) +++ trunk/admin/htaccess.class.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,556 @@ +<? + +/** +* Class to manage .htaccess file of Apache +* @author Fred Delaunay <fr...@ne...> +*/ + +class htaccess{ + var $authType; // authentification type + var $authName; // authentification name + + var $admin_files; // array of files limited to the administrators + var $modo_files; // array of files limited to the moderators + + var $file_Htpasswd; // .htpasswd file (AuthUserFile) + var $file_Htgroup; // .htgroup file (AuthGroupFile) + var $file_Htaccess; // .htaccess file + + + + function htaccess(){ + $this->authType = "Basic"; + $this->authName = "PhpFreeChat Admin Zone"; + + $this->admin_files = array("admin.php", "admin2.php"); + $this->modo_files = array("mod.php", "mod2.php"); + + + $this->file_Htpasswd = dirname(__FILE__)."/.htpasswd"; + if(!file_exists($this->file_Htpasswd)) + touch($this->file_Htpasswd); + $this->file_Htgroup = dirname(__FILE__)."/.htgroup"; + if(!file_exists($this->file_Htgroup)) { + touch($this->file_Htgroup); + $this->addGroup("admin"); + $this->addGroup("modo"); + } + $this->file_Htaccess = dirname(__FILE__)."/.htaccess"; + + } + + /***************************************/ + /* SET AND GET */ + /***************************************/ + + /** + * Set the AuthType + * @param string $authtype - AuthType is Basic or Digest (crypted) + */ + function setAuthType($authtype){ + $this->authType=$authtype; + } + /** + * Get the AuthType + * @return string $authtype - AuthType is Basic or Digest (crypted) + */ + function getAuthType(){ + return $this->authType; + } + + /** + * Set the AuthName message + * @param string $authname - AuthName message is the text display in the dialog box + */ + function setAuthName($authname){ + $this->authName=$authname; + } + /** + * Get the AuthName message + * @return string $authname - AuthName message is the text display in the dialog box + */ + function getAuthName(){ + return $this->authName; + } + + /** + * Set the .htaccess file + * @param string $filename - absolute file-path + */ + function set_file_Htaccess($filename){ + $this->file_Htaccess=$filename; + } + /** + * Get the .htaccess file + * @return string $filename - absolute file-path + */ + function get_file_Htaccess(){ + return $this->file_Htaccess; + } + + /** + * Set the .htpasswd file (AuthUserFile) + * @param string $filename - absolute file-path + */ + function set_file_Htpasswd($filename){ + $this->file_Htpasswd=$filename; + } + /** + * Get the .htpasswd file (AuthUserFile) + * @return string $filename - absolute file-path + */ + function get_file_Htpasswd(){ + return $this->file_Htpasswd; + } + + /** + * Set the .htgroup file (AuthGroupFile) + * @param string $filename - absolute file-path + */ + function set_file_Htgroup($filename){ + $this->file_Htgroup=$filename; + } + /** + * Get the .htgroup file (AuthGroupFile) + * @return string $filename - absolute file-path + */ + function get_file_Htgroup(){ + return $this->file_Htgroup; + } + + + /***************************************/ + /* USER METHODS */ + /***************************************/ + + + /** + * Check if the user exists + * @param string $username - Username + * @return boolean $UserExist - Returns true it the user exists, false if not + */ + function isUser($username){ + $UserExist = false; + $file = fopen($this->file_Htpasswd,"r"); + + while($line = fgets($file)){ + $lineArr=explode(":",$line); + if($username==$lineArr[0]){ + fclose($file); + return true; // the user exists + } + } + fclose($file); + + return false; // the user does not exist + } + + /** + * Add a user to the password file + * @param string $username - Username + * @param string $password - Password for Username + * @return boolean $created - Returns true if ok, false if the user already exists + */ + function addUser($username,$password){ + + if($this->isUser($username)==false){ + $file=fopen($this->file_Htpasswd,"a"); + if(strtolower(substr(getenv("OS"),0,7))!="windows"){ + $password=crypt($password); + } + $newLine=$username.":".$password."\n"; + fputs($file,$newLine); + fclose($file); + return true; + } + else{ + return false; // the user already exists + } + } + + + /** + * Delete a user in the password file + * @param string $username - Username to delete + * @return boolean $deleted - Returns true if user have been deleted otherwise false + */ + function delUser($username){ + // Read names from file + $file=fopen($this->file_Htpasswd,"r"); + $i=0; + $deleted = false; + while($line=fgets($file)){ + $lineArr=explode(":",trim($line)); + if($username!=$lineArr[0]){ + $newUserlist[$i][0]=$lineArr[0]; + $newUserlist[$i][1]=$lineArr[1]; + $i++; + }else{ + $deleted=true; + } + } + fclose($file); + + if($deleted==true){ + if($i==0) { // There are no more users + unlink($this->file_Htpasswd); + touch($this->file_Htpasswd); + } + else{ // Writing names back to file (without the user to delete) + $file=fopen($this->file_Htpasswd,"w"); + for($i=0;$i<count($newUserlist);$i++){ + fputs($file,$newUserlist[$i][0].":".$newUserlist[$i][1]."\n"); + } + fclose($file); + } + return true; + } + else{ + return false; + } + } + + /** + * Return an array of all users + * @return array $users - 0 if the are no user + */ + function getUsers() { + $file=fopen($this->file_Htpasswd,"r"); + for($i=0;$line=fgets($file);$i++) { + $lineArr=explode(":",$line); + if($lineArr[0]!="") { + $userlist[$i]=$lineArr[0]; + } + } + fclose($file); + if (!empty($userlist)==0) + return 0; + else + return $userlist; + } + + /** + * Return the number of users + * @return integer - the number of users + */ + function getNumberOfUsers() { + $users=$this->getUsers(); + if($users==0) + return 0; + else + return count($users); + } + + /** + * Sets a password to the given username + * @param string $username - The name of the User for changing password + * @param string $password - New Password for the User + * @return boolean $isSet - Returns true if password have been set + */ + function setPasswd($username,$new_password){ + if($this->isUser($username)==true){ + $this->delUser($username); + $this->addUser($username,$new_password); + return true; + } + else{ + return false; + } + } + + + /***************************************/ + /* GROUP METHODS */ + /***************************************/ + + /** + * Check if the group exists + * @param string $groupname - Groupname + * @return boolean $GroupExist - Returns true it the group exists, false otherwise + */ + function isGroup($groupname){ + $GroupExist = false; + $file = fopen($this->file_Htgroup,"r"); + + while($line = fgets($file)){ + $lineArr=explode(":",trim($line)); + if($groupname==trim($lineArr[0])){ + fclose($file); + return true; // the group exists + } + } + fclose($file); + + return false; // the group does not exist + } + + /** + * Add a group to the group file + * @param string $groupname - Groupname + * @return boolean $created - Returns false if the group already exists + */ + function addGroup($groupname){ + + if($this->isGroup($groupname)==false){ + $file=fopen($this->file_Htgroup,"a"); + $newLine=$groupname.": "."\n"; // Take care, it should not have a space before : + fputs($file,$newLine); + fclose($file); + return true; + } + else{ + return false; // the group already exists + } + } + + + /** + * Delete a group in the group file + * @param string $groupname - Groupname to delete + * @return boolean $deleted - Returns true if group have been deleted otherwise false + */ + function delGroup($groupname){ + // Read names from file + $file=fopen($this->file_Htgroup,"r"); + $i=0; + $newGrouplist=0; + while($line=fgets($file)){ + $lineArr=explode(":",trim($line)); + if($groupname!=trim($lineArr[0])){ + $newGrouplist[$i]=trim($line); + $i++; + }else{ + $deleted=true; + } + } + fclose($file); + + if($deleted==true){ + if($i==0) { // There are no more users + unlink($this->file_Htpasswd); + touch($this->file_Htpasswd); + } + else{ // Writing names back to file (without the user to delete) + $file=fopen($this->file_Htgroup,"w"); + for($i=0;$i<count($newGrouplist);$i++){ + fputs($file,$newGrouplist[$i]."\n"); + } + fclose($file); + } + return true; + } + else{ + return false; + } + } + + /** + * Return an array of all groups + * @return array $groups + */ + function getGroups() { + $file=fopen($this->file_Htgroup,"r"); + for($i=0;$line=fgets($file);$i++) { + $lineArr=explode(":",trim($line)); + if($lineArr[0]!="") { + $grouplist[$i]=trim($lineArr[0]); + } + } + fclose($file); + if (!empty($grouplist)==0) + return 0; + else + return $grouplist; + } + + /***************************************/ + /* USER AND GROUP METHODs */ + /***************************************/ + + /** + * Check if the user is in the group + * @param string $username - Username + * @param string $groupname - Groupname + * @return boolean $exist - Returns true it the user is in the group + */ + function isUserInGroup($username,$groupname){ + $file = fopen($this->file_Htgroup,"r"); + + while($line = fgets($file)){ + $lineArr=explode(":",trim($line)); + if($groupname==trim($lineArr[0])){ + + $lineArrUser=explode(" ",trim($lineArr[1])); + for($i=0;$i<count($lineArrUser);$i++){ + if(trim($lineArrUser[$i])==$username) + fclose($file); + return true; // the user is in the group + } + + } + } + fclose($file); + + return false; // the user in not in the group + } + + /** + * Add a user to the group file + * @param string $username - Username + * @param string $groupname - Groupname + * @return boolean $created - Returns false if the user is already in the group + */ + function addUserInGroup($username,$groupname){ + + if($this->isGroup($groupname)==false){ + $this->addGroup($groupname); + } + + if($this->isUserInGroup($username,$groupname)==false){ + // Read names from file + $file = fopen($this->file_Htgroup,"r"); + $i=0; + while($line = fgets($file)){ + $lineArr=explode(":",trim($line)); + if($groupname==trim($lineArr[0])){ + $newlist[$i]=trim($line)." ".$username; + } + else{ + $newlist[$i]=trim($line); + } + $i++; + } + fclose($file); + + + // Writing names back to file (without the user to delete) + $file=fopen($this->file_Htgroup,"w"); + for($i=0;$i<count($newlist);$i++){ + fputs($file,$newlist[$i]."\n"); + } + fclose($file); + return true; + } + else{ + return false; // the user is already in the group + } + } + + /** + * Delete a user from the group file + * @param string $username - Username + * @param string $groupname - Groupname + * @return boolean $created - Returns false if the user was not in the group + */ + function delUserFromGroup($username,$groupname){ + + if($this->isUserInGroup($username,$groupname)==true){ + + // Read names from file + $file = fopen($this->file_Htgroup,"r"); + $i=0; + while($line = fgets($file)){ + $lineArr=explode(":",trim($line)); + if($groupname==trim($lineArr[0])){ + + $lineArrUser=explode(" ",trim($lineArr[1])); + $newlist[$i]=$groupname." : "; + + for($j=0;$j<count($lineArrUser);$j++){ + if(trim($lineArrUser[$j])!=$username) + $newlist[$i].=$lineArrUser[$j]." "; + } + + } + else{ + $newlist[$i]=trim($line); + + } + $i++; + } + fclose($file); + + + // Writing names back to file (without the user to delete) + $file=fopen($this->file_Htgroup,"w"); + for($i=0;$i<count($newlist);$i++){ + fputs($file,$newlist[$i]."\n"); + } + fclose($file); + return true; + + } + else{ + return false; // the user is not in the group + } + } + + /** + * Return an array of groups from which the user belongs to + * -- Normaly, user belongs to only one group -- + * @return array $groups or 0 if the user is in none of the groups + */ + function getGroupOfUser($username) { + $file=fopen($this->file_Htgroup,"r"); + $i=0; + //$grouplist=0; + while($line = fgets($file)){ + $lineArr=explode(":",trim($line)); + $lineArrUser=explode(" ",trim($lineArr[1])); + + for($j=0;$j<count($lineArrUser);$j++){ + if(trim($lineArrUser[$j])==$username){ + $grouplist[$i]=trim($lineArr[0]); + $i++; + } + } + } + fclose($file); + if(empty($grouplist)) + return 0; + else + return $grouplist; + } + + /***************************************/ + /* WRITE the .htaccess file */ + /***************************************/ + + + + /** + * Writes the .htaccess file + */ + function printHtaccess(){ + $file=fopen($this->file_Htaccess,"w+"); + fputs($file,"AuthName \"".$this->authName."\"\n"); + fputs($file,"AuthType ".$this->authType."\n"); + fputs($file,"AuthUserFile \"".$this->file_Htpasswd."\"\n"); + fputs($file,"AuthGroupFile \"".$this->file_Htgroup."\"\n\n"); + + fputs($file,"\nrequire valid-user\n"); + + for($i=0;$i<count($this->admin_files);$i++){ + fputs($file,"\n<Files ".$this->admin_files[$i].">\n"); + fputs($file," require group admin\n"); + fputs($file,"</Files>\n"); + } + + for($i=0;$i<count($this->modo_files);$i++){ + fputs($file,"\n<Files ".$this->modo_files[$i].">\n"); + fputs($file," require group modo\n"); + fputs($file,"</Files>\n"); + } + + fclose($file); + } + + /** + * Deletes the protection of the given directory + */ + function delHtaccess(){ + unlink($this->file_Htaccess); + } + +} +?> \ No newline at end of file Added: trunk/admin/inc.conf.php =================================================================== --- trunk/admin/inc.conf.php (rev 0) +++ trunk/admin/inc.conf.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,4 @@ +<? +//$lang = "en_US"; +$lang = "fr_FR"; +?> \ No newline at end of file Added: trunk/admin/index.php =================================================================== --- trunk/admin/index.php (rev 0) +++ trunk/admin/index.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,61 @@ +<? +# lang +require_once("../src/pfci18n.class.php"); +require_once("inc.conf.php"); +pfcI18N::Init($lang,"admin"); + + +# version class +require_once("version.class.php"); +$version = new version(); +?> + +<? +// TOP // +include("index_html_top.php"); +?> + +<div class="content"> + <h2><? echo _pfc("Administration"); ?></h2> + +<? +if ($version->getPFCOfficialCurrentVersion()==0){ +?> + <div><h3><? echo _pfc("Internet connection is not possible"); ?></h3> + <ul> + <li><? echo _pfc("PFC version"); ?> : <? echo $version->getLocalVersion(); ?></li> + </ul> + </div> + +<? +} +elseif (($version->getLocalVersion())==($version->getPFCOfficialCurrentVersion())){ +?> + + <div class="ok"><h3><img src="style/check_on.png" alt="<? echo _pfc("PFC is update"); ?>"> <? echo _pfc("PFC is update"); ?></h3> + <ul> + <li><? echo _pfc("PFC version"); ?> : <? echo $version->getLocalVersion(); ?></li> + </ul> + </div> + +<? +} +else{ +?> + <div class="ko"><h3><img src="style/check_off.png" alt="<? echo _pfc("PFC is not update"); ?>"> <? echo _pfc("PFC is not update"); ?></h3> + <ul> + <li><? echo _pfc("Your version"); ?> : <? echo $version->getLocalVersion(); ?></li> + <li><? echo _pfc("The last official version"); ?> : <? echo $version->getPFCOfficialCurrentVersion(); ?></li> + <li><? echo _pfc("Download the last version %s here %s.","<a href=\"http://sourceforge.net/project/showfiles.php?group_id=158880\">","</a>"); ?></li> + </ul> + </div> + +<? +} +?> +</div> + +<? +// BOTTOM +include("index_html_bottom.php"); +?> \ No newline at end of file Added: trunk/admin/index_html_bottom.php =================================================================== --- trunk/admin/index_html_bottom.php (rev 0) +++ trunk/admin/index_html_bottom.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,13 @@ + +<div class="footer"> + <div class="valid"> + <a href="http://validator.w3.org/check?uri=referer"> + <img alt="Valid XHTML 1.0!" src="style/valid-xhtml.png"> + </a> + <a href="http://jigsaw.w3.org/css-validator/check/referer"> + <img alt="Valid CSS!" src="style/valid-css.png"> + </a> + </div> + <p>\xA92006 phpFreeChat</p> + </div> +</body></html> \ No newline at end of file Added: trunk/admin/index_html_top.php =================================================================== --- trunk/admin/index_html_top.php (rev 0) +++ trunk/admin/index_html_top.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,57 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=utf-8"> + <title>phpFreeChat - Administration</title> + <link rel="stylesheet" title="classic" type="text/css" href="style/generic.css"> + <link rel="stylesheet" title="classic" type="text/css" href="style/header.css"> + <link rel="stylesheet" title="classic" type="text/css" href="style/footer.css"> + <link rel="stylesheet" title="classic" type="text/css" href="style/menu.css"> + <link rel="stylesheet" title="classic" type="text/css" href="style/content.css"> + <script type="text/javascript" src="style/show.js"></script> + </head> + <body> + +<div class="header"> + <h1>phpFreeChat - Administration</h1> + <img alt="logo bulle" src="style/bulle.png" class="logo2"> +</div> + +<div class="menu"> + <ul> + <li class="sub title">General</li> + <li> + <ul class="sub"> + <li class="item"> + <a href="index.php">Administration Index</a> + <li class="item"> + <a href="../index.php">PFC Index</a> + </li> + </li> + <li class="item"> + <a href="user.php">Users</a> + </li> + <li class="item"> + <a href="configuration.php">Configuration</a> + </li> + <li class="item"> + <a href="themes.php">Themes</a> + </li> + </ul> + </li> + <li class="sub title">Other</li> + <li> + <ul> + <li class="item"> + <a href="#">other</a> + </li> + <li class="item"> + <a href="#">other</a> + </li> + </ul> + </li> + </ul> + <p class="partner"> + <a href="http://www.phpfreechat.net"><img alt="logo big" src="style/logo_88x31.gif"></a> + </p> +</div> Added: trunk/admin/style/bulle.png =================================================================== (Binary files differ) Property changes on: trunk/admin/style/bulle.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/style/check_off.png =================================================================== (Binary files differ) Property changes on: trunk/admin/style/check_off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/style/check_on.png =================================================================== (Binary files differ) Property changes on: trunk/admin/style/check_on.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/style/content.css =================================================================== --- trunk/admin/style/content.css (rev 0) +++ trunk/admin/style/content.css 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,34 @@ +/* --- CONTENT --- */ +div.content { + margin: 0.5em; + padding: 1em; + margin-left: 12.2em; + background-color: #FFF; + border: 1px #acd233 solid; + min-height: 40em; +} +div.content * { margin-top: 0.5em; margin-bottom: 0.5em; } +div.content h2 { border-bottom: 1px #444 solid; } +div.content h3 { text-decoration: underline; font-size: 100%; margin: 1em 0 1em 0; } +div.content a:link, div.content a:visited, div.content a:hover, div.content a:visited{ color: #0081ac; } +div.content code { background-color: #EFE; border: 1px #444 dotted; } +div.content pre { padding: 1em; background-color: #EFE; border: 1px #444 dotted; } +div.content ul { margin-left: 2em; } +div.content ol { margin-left: 3em; } +div.content dd { margin-left: 3em; } +div.content dt { font-weight: bold; margin: 2em 0 2em 0; } +div.content img { vertical-align: bottom;} +div.content .abstract { border: 2px #999 solid; background-color: #EEE; padding: 1em; color: #000; text-align: justify; } + +/* ----------------- */ +div.ok h3, div.message h3 { text-decoration: none; font-size: 100%; margin: 1em 0 1em 0; color: #339933;} +div.ko h3 { text-decoration: none; font-size: 100%; margin: 1em 0 1em 0; color: #FF0000;} + +div.showbox * { margin-top: 0; margin-bottom: 0; } +div.showbox p { margin-top: 0.2em; } +div.showbox { border : 1px solid #ccc; border-top-width : 2px; padding : 0 0.5em; margin : 0 0 0.5em 0;} +div.showbox h4 { background : #eceade; margin : 0 -0.5em; padding : 0.2em 0.5em; font-size : 1em; font-family : Verdana,Arial,Helevetica,sans-serif; } +.field label { display : block; float : left; width : 10em;} + + + Added: trunk/admin/style/footer.css =================================================================== --- trunk/admin/style/footer.css (rev 0) +++ trunk/admin/style/footer.css 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,21 @@ +/* --- FOOTER --- */ +div.footer { + position: relative; + text-align: center; + background-color: #99cc33; + color: #FFF; + border-top: 1px #acd233 solid; + border-bottom: 1px #acd233 solid; + font-size: 80%; + clear: both; + padding-left: 12em; +} +div.footer div.valid { + display: inline; + float: right; +} +div.footer div.rss { + position: absolute; + left: 5px; + float: left; +} Added: trunk/admin/style/generic.css =================================================================== --- trunk/admin/style/generic.css (rev 0) +++ trunk/admin/style/generic.css 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,20 @@ +/* --- GENERIC --- */ +* { padding: 0; margin: 0; } +a img { border: none; } +body { + color: #000000; + background: #339933; + font-family: Verdana, Sans-Serif; + font-size: 100%; + padding: 0; + margin: 0; +} + +a:link, a:visited, a:hover { + font-weight: bold; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +.nospace { word-spacing: -0.35em; } Added: trunk/admin/style/header.css =================================================================== --- trunk/admin/style/header.css (rev 0) +++ trunk/admin/style/header.css 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,23 @@ +/* --- HEADER --- */ +div.header { + position: relative; + display: block; + background-color: #99cc33; + border-bottom: 1px #acd233 solid; + height: 45px; +} +div.header h1 { + color: #FFF; + text-align: center; +} +div.header .logo2 { + position: absolute; + bottom: 0; + right: 0; +} +div.header .flags { + position: absolute; + bottom: 2px; + left: 0px; +} +div.header .flags a { margin-left: 0.5em; } Added: trunk/admin/style/logo_88x31.gif =================================================================== (Binary files differ) Property changes on: trunk/admin/style/logo_88x31.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/style/menu.css =================================================================== --- trunk/admin/style/menu.css (rev 0) +++ trunk/admin/style/menu.css 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,63 @@ +/* --- MENU --- */ +div.menu { + position: absolute; + top: 55px; + left: 0.5em; +/* float: left; + margin-top: 0.5em; + margin-left: 0.4em;*/ + color: #FFF; + width: 11em; + text-align: center; +} +div.menu * { font-size: 95%; } +div.menu ul { + background-color: #99cc33; + border: 1px #acd233 solid; + text-align: left; + list-style: none; +} +div.menu li { + display: inline; +} +div.menu img { margin-top: 10px; } +div.menu .title { + padding: 4px; + text-align: center; + color: #888; + background-color: #FFF; +} +div.menu li.sub { + font-weight: bold; + padding: 0; + margin: 0; + display: block; +} +div.menu li a { + display: block; + margin: 0px; + padding: 4px; + padding-left: 10px; + width: auto; +} +div.menu li.item { + display: inline; +} +div.menu a:link, div.menu a:visited, div.menu a:hover { color: #FFF; } +div.menu a:visited { color: #FFF; } +div.menu li.item a:hover, div.menu ul.sub li.item a:hover { + display: block; + background-color: #acd233; + text-decoration: none; +} + +div.menu .partner { + margin-top: 5px; +} +div.menu div.rating { + margin-top: 10px; +} +div.menu div.rating table, div.menu div.rating table td { + text-align: center; + margin: auto; +} Added: trunk/admin/style/show.js =================================================================== --- trunk/admin/style/show.js (rev 0) +++ trunk/admin/style/show.js 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,34 @@ +function getE(id) +{ + if(document.getElementById) { + return document.getElementById(id); + } else if(document.all) { + return document.all[id]; + } else return; +} + +function openClose(id,mode) +{ + element = getE(id); + img = getE('img_'+id); + + if(element.style) { + if(mode == 0) { + if(element.style.display == 'block' ) { + element.style.display = 'none'; + img.src = 'pics/plus.gif'; + } else { + element.style.display = 'block'; + img.src = 'pics/moins.gif'; + } + } else if(mode == 1) { + element.style.display = 'block'; + img.src = 'pics/moins.gif'; + } else if(mode == -1) { + element.style.display = 'none'; + img.src = 'pics/plus.gif'; + } + } +} + + Added: trunk/admin/style/valid-css.png =================================================================== (Binary files differ) Property changes on: trunk/admin/style/valid-css.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/style/valid-xhtml.png =================================================================== (Binary files differ) Property changes on: trunk/admin/style/valid-xhtml.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/admin/themes.class.php =================================================================== --- trunk/admin/themes.class.php (rev 0) +++ trunk/admin/themes.class.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,181 @@ +<? + +/** +* Class to manage theme of pfc +* @author Fred Delaunay <fr...@ne...> +*/ + +class themes{ + var $dir_themes; // directory of themes + + + + function themes(){ + $this->dir_themes = dirname(__FILE__)."/../themes/"; + } + + /** + * Get the list of themes + * @return array $themes_list + */ + function getThemesList(){ + $i=0; + $dir = opendir($this->dir_themes); + while ($f = readdir($dir)) { + if(is_dir($this->dir_themes.$f) && $f!="." && $f!="..") { + $themes_list[$i] = $f; + $i++; + } + } + + if($i>0) + return $themes_list; + else + return 0; + } + + /** + * Get the Author of a theme + * @param string $theme + * @return string $author + */ + function getThemeAuthor($theme){ + if(file_exists($this->dir_themes.$theme."/info.php")){ + include($this->dir_themes.$theme."/info.php"); + if(empty($author)) + return 0; + else + return $author; + } + else{ + return 0; + } + } + + + /** + * Get the Website of a theme + * @param string $theme + * @return string $website + */ + function getThemeWebsite($theme){ + if(file_exists($this->dir_themes.$theme."/info.php")){ + include($this->dir_themes.$theme."/info.php"); + if(empty($website)) + return 0; + else + return $website; + } + else{ + return 0; + } + } + + /** + * Get the info of a theme + * @param string $theme + * @return string $info + */ + function getThemeInfo($theme){ + $author = $this->getThemeAuthor($theme); + $website = $this->getThemeWebsite($theme); + $screenshot = $this->getThemeScreenshot($theme); + + if ($author!='0') $info = "$author"; + if ($author!='0' && $website!='0') $info .= " - "; + if ($website!='0') $info .= "<a href=\"$website\">$website</a>"; + if (($author!='0' || $website!='0') && ($screenshot!='0')) $info .= " - "; + if ($screenshot!='0') $info .= "<a href=\"$screenshot\">"._pfc("Screenshot")."</a>"; + + if(empty($info)) + return 0; + else + return $info; + } + + + /** + * Get the screenshot of a theme + * @param string $theme + * @return string $screenshot + */ + function getThemeScreenshot($theme){ + if(file_exists($this->dir_themes.$theme."/info.php")){ + include($this->dir_themes.$theme."/info.php"); + if(empty($screenshot)) + return 0; + else + return $screenshot; + } + else{ + return 0; + } + } + + /** + * Search if the imagess folder theme is present + * @param string $theme + * @return boolean - true if the /themes/name/images folder is present + */ + function isThemeImages($theme){ + if(is_dir($this->dir_themes.$theme."/images")){ + return true; + } + else{ + return false; + } + } + + /** + * Search if the smiley theme is present + * @param string $theme + * @return boolean - true if the /themes/name/smiley/theme file is present + */ + function isThemeSmiley($theme){ + if(file_exists($this->dir_themes.$theme."/smileys/theme")){ + return true; + } + else{ + return false; + } + } + + /** + * Search if the templates folder theme is present + * @param string $theme + * @return boolean - true if the /themes/name/templates folder is present + */ + function isThemeTemplates($theme){ + if(is_dir($this->dir_themes.$theme."/templates")){ + return true; + } + else{ + return false; + } + } + + + /** + * Get the file from the templates themes/name/ directory + * @return array $templates_files_list + */ + function getThemesTemplatesFilesList($theme){ + $i=0; + $dir_templates = $this->dir_themes.$theme."/templates/"; + $dir = opendir($dir_templates); + while ($f = readdir($dir)) { + if(is_file($dir_templates.$f) && $f!="." && $f!="..") { + $templates_files_list[$i] = $f; + $i++; + } + } + + if($i>0) + return $templates_files_list; + else + return 0; + } + +} + +?> \ No newline at end of file Added: trunk/admin/themes.php =================================================================== --- trunk/admin/themes.php (rev 0) +++ trunk/admin/themes.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,66 @@ +<? +# lang +require_once("../src/pfci18n.class.php"); +require_once("inc.conf.php"); +pfcI18N::Init($lang,"admin"); + +# themes class +require_once("themes.class.php"); +$themes = new themes(); + +?> + +<? +// TOP // +include("index_html_top.php"); +?> + +<div class="content"> + <h2><? echo _pfc("Available themes"); ?></h2> +<? + + $themes_list = $themes->getThemesList(); + for($i=0;$i<count($themes_list);$i++) { + + echo "<div class=\"showbox\">"; + echo "<h4><a href=\"#\" onclick=\"openClose('$themes_list[$i]', 0); return false;\">".$themes_list[$i]."</a>"; + $info = $themes->getThemeInfo($themes_list[$i]); + if ($info!='0') echo " ( $info ) "; + echo "</h4>"; + + echo "<div id=\"$themes_list[$i]\" style=\"display: none;\">"; + echo "<ul>"; + + if($themes->isThemeImages($themes_list[$i])) + echo "<li>Images <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + else + echo "<li>Images <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + + if($themes->isThemeSmiley($themes_list[$i])) + echo "<li>Smiley <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + else + echo "<li>Smiley <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + + if($themes->isThemeTemplates($themes_list[$i])){ + echo "<li>Templates <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + $templates_files_list = $themes->getThemesTemplatesFilesList($themes_list[$i]); + echo "<ul>"; + for($j=0;$j<count($templates_files_list);$j++) { + echo "<li>$templates_files_list[$j]</li>"; + } + echo "</ul>"; + } + else + echo "<li>Templates <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + echo "</ul>"; + echo "</div>"; + echo "</div>"; + } + +?> +</div> + +<? +// BOTTOM +include("index_html_bottom.php"); +?> \ No newline at end of file Added: trunk/admin/themes_avant.php =================================================================== --- trunk/admin/themes_avant.php (rev 0) +++ trunk/admin/themes_avant.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,61 @@ +<? +require_once("themes.class.php"); +$themes = new themes(); + + +?> + +<? +// TOP // +include("index_html_top.php"); +?> + +<div class="content"> + <h2>Liste des themes disponibles</h2> +<? + echo "<ul>"; + $themes_list = $themes->getThemesList(); + for($i=0;$i<count($themes_list);$i++) { + $author = $themes->getThemeAuthor($themes_list[$i]); + $website = $themes->getThemeWebsite($themes_list[$i]); + + echo "<li><strong>$themes_list[$i]</strong>"; + if ($author!='0' || $website!='0') echo " ( $author - <a href=\"$website\">$website</a> )"; + echo "</li>"; + echo "<ul>"; + + + + + if($themes->isThemeImages($themes_list[$i])) + echo "<li>Images <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + else + echo "<li>Images <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + + if($themes->isThemeSmiley($themes_list[$i])) + echo "<li>Smiley <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + else + echo "<li>Smiley <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + + if($themes->isThemeTemplates($themes_list[$i])){ + echo "<li>Templates <img src=\"style/check_on.png\" alt=\"On\" /></li>"; + $templates_files_list = $themes->getThemesTemplatesFilesList($themes_list[$i]); + echo "<ul>"; + for($j=0;$j<count($templates_files_list);$j++) { + echo "<li>$templates_files_list[$j]</li>"; + } + echo "</ul>"; + } + else + echo "<li>Templates <img src=\"style/check_off.png\" alt=\"Off\" /></li>"; + + echo "</ul>"; + } + echo "</ul>"; +?> +</div> + +<? +// BOTTOM +include("index_html_bottom.php"); +?> \ No newline at end of file Added: trunk/admin/user.php =================================================================== --- trunk/admin/user.php (rev 0) +++ trunk/admin/user.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,161 @@ +<?php + +# lang +require_once("../src/pfci18n.class.php"); +require_once("inc.conf.php"); +pfcI18N::Init($lang,"admin"); + +# htaccess class +require_once ('htaccess.class.php'); +$ht = new htaccess(); + +# Activate Authentification +if(!empty($_GET['active'])){ + if($_GET['active']==1 && $ht->getNumberOfUsers()>0) $ht->printHtaccess(); + elseif($_GET['active']==1 && $ht->getNumberOfUsers()==0){ + $msg = _pfc("At least one user must be declare to activate authentication."); + header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); + exit; + } + elseif($_GET['active']==2 && file_exists($ht->get_file_Htaccess())) $ht->delHtaccess(); +} + +# Delete a user +if(!empty($_GET['del']) && !empty($_GET['username']) ) +{ + if($ht->getNumberOfUsers()==1){ + $msg = _pfc("It is not possible to delete the last user."); + header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); + exit; + } + else{ + $username = $_GET['username']; + $ht->delUser($username); + + $groups = $ht->getGroupOfUser($username); + if ($groups!=0){ #User is not in a group + for($i=0;$i<count($groups);$i++) { + $ht->delUserFromGroup($username,$groups[$i]); + } + } + + $msg = _pfc("User %s deleted.",$username); + header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); + exit; + } +} + +# Modification or Creation of a user +if(!empty($_POST['username'])){ + $username = $_POST['username']; + $password = $_POST['password']; + $create=0; + + if(!$ht->isUser($username)){ #Add User + if(!empty($password)) { + $ht->addUser($username,$password); + $create=1; + } + } + else{ #Modify User + if(!empty($password)) + $ht->setPasswd($username,$password); + } + + $groups= $ht->getGroups(); + for($j=0;$j<count($groups);$j++) { + $group = $_POST['group']; + if($group==$groups[$j]) + $ht->addUserInGroup($username,$groups[$j]); + else + $ht->delUserFromGroup($username,$groups[$j]); + } + + + if($create==1) + $msg = _pfc("User %s added.", $username); + else + $msg = _pfc("User %s edited.", $username); + header('Location: '.$_SERVER['PHP_SELF'].'?msg='.rawurlencode($msg)); + exit; + +} +?> + +<? +// TOP // +include("index_html_top.php"); +?> + +<div class="content"> +<h2><? echo _pfc("Users management"); ?></h2> + +<? + if(!file_exists($ht->get_file_Htaccess())) + echo "<div class=\"ko\"><h3><img src=\"style/check_off.png\" alt=\""._pfc("Authentication disable")."\"> "._pfc("Authentication disable")." - <a href=\"".$_SERVER['PHP_SELF']."?active=1\">"._pfc("Enable here")."</a></h3></div>"; + else{ + echo "<div class=\"ok\"><h3><img src=\"style/check_on.png\" alt=\""._pfc("Authentication enable")."\"> "._pfc("Authentication enable")." - <a href=\"".$_SERVER['PHP_SELF']."?active=2\">"._pfc("Disable here")."</a></h3></div>"; + + } + + + if(!empty($_GET['msg'])) + echo "<div class=\"message\"><h3>".$_GET['msg']."</h3></div>"; + + $users= $ht->getUsers(); + if($users!=0) { + for($i=0;$i<count($users);$i++) { + echo "<div class=\"showbox\">"; + echo "<h4>".$users[$i]; + echo " [ <a style=\"font-weight: normal;\" href=\"#\" onclick=\"openClose('$users[$i]', 0); return false;\">"._pfc("Edit")."</a> - <a style=\"font-weight: normal;\" href=\"".$_SERVER['PHP_SELF']."?username=$users[$i]&del=1\" onclick=\"return window.confirm('"._pfc("Do you really want to delete %s ?",$users[$i])."')\">"._pfc("Delete")."</a> ]</p>"; + echo "</h4>"; + echo "<div id=\"$users[$i]\" style=\"display: none;\">"; + echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; + echo " <input type=\"hidden\" name=\"username\" id=\"username\" value=\"$users[$i]\" />"; + echo " <p class=\"field\"><label for=\"password\">"._pfc("Password").": </label><input type=\"text\" size=\"30\" name=\"password\" id=\"password\" /></p>"; + + echo " <p class=\"field\"><label for=\"group\">"._pfc("Group").": </label><select name=\"group\" id=\"group\">"; + $groups= $ht->getGroups(); + for($j=0;$j<count($groups);$j++) { + if ($ht->isUserInGroup($users[$i],$groups[$j])) + $selected = "selected=\"selected\""; + else + $selected = ""; + echo "<option value=\"".$groups[$j]."\" $selected>".$groups[$j]."</option>"; + } + echo " </select></p>"; + + echo " <p class=\"field\"><input class=\"submit\" type=\"submit\" value=\"ok\"/></p>"; + echo "</form>"; + echo "</div>"; + echo "</div>"; + } + } + + + + echo "<div class=\"showbox\">"; + echo "<h4>"._pfc("Add a new user")."</h4>"; + echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; + echo " <p class=\"field\"><label for=\"username\" >"._pfc("Username").": </label><input type=\"text\" size=\"30\" maxlength=\"32\" name=\"username\" id=\"username\" /> </p>"; + echo " <p class=\"field\"><label for=\"password\" >"._pfc("Password").": </label><input type=\"text\" size=\"30\" name=\"password\" id=\"password\" /></p>"; + + echo " <p class=\"field\"><label for=\"group\" >"._pfc("Group").": </label><select name=\"group\" id=\"group\" >"; + $groups= $ht->getGroups(); + for($j=0;$j<count($groups);$j++) { + echo "<option value=\"".$groups[$j]."\" >".$groups[$j]."</option>"; + } + echo " </select></p>"; + + echo " <p class=\"field\"><input class=\"submit\" type=\"submit\" value=\"ok\"/></p>"; + echo "</form>"; + echo "</div>"; + +?> + +</div> + +<? +// BOTTOM +include("index_html_bottom.php"); +?> \ No newline at end of file Added: trunk/admin/version.class.php =================================================================== --- trunk/admin/version.class.php (rev 0) +++ trunk/admin/version.class.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,46 @@ +<? + +/** +* Class to manage theme of pfc +* @author Fred Delaunay <fr...@ne...> +*/ + +class version{ + var $local_version; // file of the user version + var $pfc_official_current_version; // file of the pfc official current version + + + function version(){ + $this->local_version = dirname(__FILE__)."/../version"; + $this->pfc_official_current_version = "http://www.phpfreechat.net/version"; + } + + /** + * Get the local version + * @return integer version + */ + function getLocalVersion(){ + $fp = fopen($this->local_version,"r"); + $version = trim(fgets($fp)); + fclose($fp); + return $version; + } + + /** + * Get the pfc official current version + * @return integer version + */ + function getPFCOfficialCurrentVersion(){ + if (file_exists($this->pfc_official_current_version)) { + $fp = fopen($this->pfc_official_current_version,"r"); + $version = trim(fgets($fp)); + fclose($fp); + return $version; + } + else + return 0; + } + +} + +?> \ No newline at end of file Added: trunk/i18n/en_US/admin.php =================================================================== --- trunk/i18n/en_US/admin.php (rev 0) +++ trunk/i18n/en_US/admin.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,68 @@ +<?php +/** + * i18n/en_US/main.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +/** + * English translation of the messages (utf8 encoded!) + * + * @author Nemako <fr...@ne...> + */ + +// admin/index.php +$GLOBALS["i18n"]["Administration"] = "Administration"; +$GLOBALS["i18n"]["Internet connection is not possible"] = "Internet connection is not possible"; +$GLOBALS["i18n"]["PFC is update"] = "PFC is update"; +$GLOBALS["i18n"]["PFC version"] = "PFC version"; +$GLOBALS["i18n"]["The last official version"] = "The last official version"; +$GLOBALS["i18n"]["PFC is not update"] = "PFC is not update"; +$GLOBALS["i18n"]["Your version"] = "Your version"; +$GLOBALS["i18n"]["Download the last version %s here %s."] = "Télécharger la dernière version %s ici %s."; + + +// admin/user.php +$GLOBALS["i18n"]["Users management"] = "Users management"; +$GLOBALS["i18n"]["At least one user must be declare to activate authentication."] = "At least one user must be declare to activate authentication."; +$GLOBALS["i18n"]["It is not possible to delete the last user."] = "It is not possible to delete the last user."; + +$GLOBALS["i18n"]["User %s deleted."] = "User %s deleted."; +$GLOBALS["i18n"]["User %s added."] = "User %s added."; +$GLOBALS["i18n"]["User %s edited."] = "User %s edited."; + +$GLOBALS["i18n"]["Authentication disable"] = "Authentication disable"; +$GLOBALS["i18n"]["Enable here"] = "Activate here"; +$GLOBALS["i18n"]["Authentication enable"] = "Authentication enable"; +$GLOBALS["i18n"]["Disable here"] = "Disable here"; + +$GLOBALS["i18n"]["Username"] = "Username"; +$GLOBALS["i18n"]["Password"] = "Password"; +$GLOBALS["i18n"]["Group"] = "Group"; + +$GLOBALS["i18n"]["Do you really want to delete %s ?"] = "Do you really want to delete %s ?"; +$GLOBALS["i18n"]["Add a new user"] = "Add a new user"; + +$GLOBALS["i18n"]["Edit"] = "Edit"; +$GLOBALS["i18n"]["Delete"] = "Delete"; + +// admin/themes.php +$GLOBALS["i18n"]["Available themes"] = "Available themes"; +$GLOBALS["i18n"]["Screenshot"] = "Screenshot"; + +?> Added: trunk/i18n/fr_FR/admin.php =================================================================== --- trunk/i18n/fr_FR/admin.php (rev 0) +++ trunk/i18n/fr_FR/admin.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,70 @@ +<?php +/** + * i18n/en_US/main.php + * + * Copyright © 2006 Stephane Gully <ste...@gm...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the + * Free Software Foundation, 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA + */ + +/** + * English translation of the messages (utf8 encoded!) + * + * @author Stephane Gully <ste...@gm...> + */ + +// admin/index.php +$GLOBALS["i18n"]["Administration"] = "Administration"; +$GLOBALS["i18n"]["Internet connection is not possible"] = "La connexion à Internet n'est pas possible"; +$GLOBALS["i18n"]["PFC is update"] = "PFC est pas à jour"; +$GLOBALS["i18n"]["PFC version"] = "version de PFC"; +$GLOBALS["i18n"]["The last official version"] = "La dernière version officielle"; +$GLOBALS["i18n"]["PFC is not update"] = "PFC n'est pas à jour"; +$GLOBALS["i18n"]["Your version"] = "Votre version"; +$GLOBALS["i18n"]["The last official version"] = "La dernière version officielle"; +$GLOBALS["i18n"]["Download the last version %s here %s."] = "Download the last version %s here %s."; + + +// admin/user.php +$GLOBALS["i18n"]["Users management"] = "Gestion des utilisateurs"; + +$GLOBALS["i18n"]["At least one user must be declare to activate authentication."] = "Au moins un utilisateur doit être créé pour activer une authentification."; +$GLOBALS["i18n"]["It is not possible to delete the last user."] = "Il est impossible de supprimer le dernier utilisateur."; + +$GLOBALS["i18n"]["User %s deleted."] = "Utilisateur %s supprimé."; +$GLOBALS["i18n"]["User %s added."] = "Utilisateur %s ajouté."; +$GLOBALS["i18n"]["User %s edited."] = "Utilisateur %s modifé."; + +$GLOBALS["i18n"]["Authentication disable"] = "Authentification désactivée"; +$GLOBALS["i18n"]["Enable here"] = "Activer ici"; +$GLOBALS["i18n"]["Authentication enable"] = "Authentification activée"; +$GLOBALS["i18n"]["Disable here"] = "Désactiver ici"; + +$GLOBALS["i18n"]["Username"] = "Utilisateur"; +$GLOBALS["i18n"]["Password"] = "Mot de passe"; +$GLOBALS["i18n"]["Group"] = "Groupe"; + +$GLOBALS["i18n"]["Do you really want to delete %s ?"] = "Voulez-vous vraiment supprimer %s ?"; +$GLOBALS["i18n"]["Add a new user"] = "Ajouter un nouvel utilisateur"; + +$GLOBALS["i18n"]["Edit"] = "Modifier"; +$GLOBALS["i18n"]["Delete"] = "Supprimer"; + +// admin/themes.php +$GLOBALS["i18n"]["Available themes"] = "Liste des themes disponibles"; +$GLOBALS["i18n"]["Screenshot"] = "Capture d'écran"; + +?> Modified: trunk/src/pfci18n.class.php =================================================================== --- trunk/src/pfci18n.class.php 2006-04-24 14:01:11 UTC (rev 463) +++ trunk/src/pfci18n.class.php 2006-04-24 14:40:06 UTC (rev 464) @@ -31,11 +31,14 @@ class pfcI18N { - function Init($language) + function Init($language,$type='admin') { if (!in_array($language, pfcI18N::GetAcceptedLanguage())) $language = pfcI18N::GetDefaultLanguage(); - require_once(dirname(__FILE__)."/../i18n/".$language."/main.php"); + if ($type=="admin") + require_once(dirname(__FILE__)."/../i18n/".$language."/admin.php"); + else + require_once(dirname(__FILE__)."/../i18n/".$language."/main.php"); $GLOBALS["output_encoding"] = "UTF-8"; // by default client/server communication is utf8 encoded } Added: trunk/themes/blune/info.php =================================================================== --- trunk/themes/blune/info.php (rev 0) +++ trunk/themes/blune/info.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,5 @@ +<? +$author = "Nemako"; +$website = "http://www.nemako.net"; +$screenshot = "http://img111.imageshack.us/img111/1681/blune1xe.png"; +?> \ No newline at end of file Added: trunk/themes/cerutti/info.php =================================================================== --- trunk/themes/cerutti/info.php (rev 0) +++ trunk/themes/cerutti/info.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,3 @@ +<? +$author = "Victor Cerutti"; +?> \ No newline at end of file Added: trunk/themes/default/info.php =================================================================== --- trunk/themes/default/info.php (rev 0) +++ trunk/themes/default/info.php 2006-04-24 14:40:06 UTC (rev 464) @@ -0,0 +1,4 @@ +<? +$author = "kerphi"; +$website = "http://www.phpfreechat.net"; +?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |