Changeset 222
- Timestamp:
- 02/21/06 23:52:15 (3 years ago)
- Files:
-
- bureau/admin/adm_doadd.php (modified) (2 diffs)
- bureau/admin/adm_dodel.php (modified) (3 diffs)
- bureau/admin/adm_doedit.php (modified) (2 diffs)
- bureau/admin/adm_edit.php (modified) (7 diffs)
- bureau/admin/adm_list.php (modified) (7 diffs)
- bureau/admin/adm_list2.php (added)
- bureau/admin/adm_login.php (modified) (2 diffs)
- bureau/admin/adm_quotadoedit.php (modified) (4 diffs)
- bureau/admin/adm_quotaedit.php (modified) (2 diffs)
- bureau/admin/bro_main.php (modified) (3 diffs)
- bureau/admin/index.php (modified) (2 diffs)
- bureau/admin/main.php (modified) (2 diffs)
- bureau/admin/mem_cm.php (modified) (2 diffs)
- bureau/admin/mem_cm2.php (modified) (2 diffs)
- bureau/admin/menu.php (modified) (2 diffs)
- bureau/admin/menu_adm.php (modified) (2 diffs)
- bureau/admin/menu_aide.php (modified) (2 diffs)
- bureau/admin/menu_mail.php (modified) (2 diffs)
- bureau/admin/menulist.txt (modified) (1 diff)
- bureau/admin/plugins/procmail_builder/m_procmail.php (modified) (12 diffs)
- bureau/admin/sql_add.php (modified) (2 diffs)
- bureau/class/config.php (modified) (2 diffs)
- bureau/class/config_nochk.php (added)
- bureau/class/config_real.php (added)
- bureau/class/cryptall.php (added)
- bureau/class/export_account.php (added)
- bureau/class/functions.php (modified) (3 diffs)
- bureau/class/m_admin.php (modified) (14 diffs)
- bureau/class/m_bro.php (modified) (19 diffs)
- bureau/class/m_dom.php (modified) (23 diffs)
- bureau/class/m_err.php (modified) (2 diffs)
- bureau/class/m_ftp.php (modified) (18 diffs)
- bureau/class/m_hta.php (modified) (6 diffs)
- bureau/class/m_mail.php (modified) (27 diffs)
- bureau/class/m_mem.php (modified) (25 diffs)
- bureau/class/m_mysql.php (modified) (21 diffs)
- bureau/class/m_quota.php (modified) (13 diffs)
- bureau/class/m_stats.php (modified) (26 diffs)
- bureau/class/reset_stats_conf.php (added)
- bureau/locales/en_US/LC_MESSAGES/mysql.po (modified) (2 diffs)
- bureau/locales/es_ES/LC_MESSAGES/admin.po (modified) (10 diffs)
- bureau/locales/es_ES/LC_MESSAGES/bro.po (modified) (6 diffs)
- bureau/locales/es_ES/LC_MESSAGES/dom.po (modified) (5 diffs)
- bureau/locales/es_ES/LC_MESSAGES/err.po (modified) (1 diff)
- bureau/locales/es_ES/LC_MESSAGES/ftp.po (modified) (3 diffs)
- bureau/locales/es_ES/LC_MESSAGES/hta.po (modified) (4 diffs)
- bureau/locales/es_ES/LC_MESSAGES/mail.po (modified) (6 diffs)
- bureau/locales/es_ES/LC_MESSAGES/main.po (modified) (4 diffs)
- bureau/locales/es_ES/LC_MESSAGES/mem.po (modified) (1 diff)
- bureau/locales/es_ES/LC_MESSAGES/mysql.po (modified) (5 diffs)
- bureau/locales/es_ES/LC_MESSAGES/stats.po (modified) (6 diffs)
- bureau/locales/fr_FR/LC_MESSAGES/mysql.po (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bureau/admin/adm_doadd.php
r1 r222 1 1 <?php 2 2 /* 3 $Id: adm_doadd.php,v 1. 1.1.1 2003/03/26 17:41:29 rootExp $3 $Id: adm_doadd.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 42 42 43 43 // Add here all what you want when an account is created ! 44 $ff=new m_ftp($u); 45 $ff->add_ftp($login,"",$pass,"/"); 46 44 $mem->su($u); 45 $ftp->add_ftp($login,"",$pass,"/"); 46 $mem->unsu(); 47 47 48 $error=_("The new member has been successfully created"); 48 49 bureau/admin/adm_dodel.php
r1 r222 1 1 <?php 2 2 /* 3 $Id: adm_dodel.php,v 1. 1.1.1 2003/03/26 17:41:29 rootExp $3 $Id: adm_dodel.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 35 35 } 36 36 37 37 38 if (!is_array($d)) { 38 39 $d[]=$d; … … 41 42 reset($d); 42 43 while (list($key,$val)=each($d)) { 44 if (!$admin->checkcreator($val)) { 45 __("This page is restricted to authorized staff"); 46 exit(); 47 } 43 48 if (!($u=$admin->get($val)) || !$admin->del_mem($val)) { 44 49 $error.=sprintf(_("Member '%s' does not exist"),$val)."<br />"; bureau/admin/adm_doedit.php
r164 r222 1 1 <?php 2 2 /* 3 $Id: adm_doedit.php,v 1. 2 2003/10/22 08:18:53benjamin Exp $3 $Id: adm_doedit.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 30 30 require_once("../class/config.php"); 31 31 32 if ( $back) {33 include("adm_list.php");34 exit ;32 if (!$admin->enabled) { 33 __("This page is restricted to authorized staff"); 34 exit(); 35 35 } 36 if (!$admin-> enabled) {36 if (!$admin->checkcreator($uid)) { 37 37 __("This page is restricted to authorized staff"); 38 38 exit(); bureau/admin/adm_edit.php
r164 r222 1 1 <?php 2 2 /* 3 $Id: adm_edit.php,v 1. 7 2003/10/22 08:18:53benjamin Exp $3 $Id: adm_edit.php,v 1.8 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 34 34 exit(); 35 35 } 36 if (!$admin->checkcreator($uid)) { 37 __("This page is restricted to authorized staff"); 38 exit(); 39 } 36 40 37 41 if (!$r=$admin->get($uid)) { … … 61 65 <?php 62 66 echo "<option"; 63 if ( !$r["enabled"]) echo " selected=\"selected\"";67 if ($r["enabled"]=="0") echo " selected=\"selected\""; 64 68 echo " value=\"0\">"._("No")."</option>"; 65 69 echo "<option"; 66 if ($r["enabled"] ) echo " selected=\"selected\"";70 if ($r["enabled"]=="1") echo " selected=\"selected\""; 67 71 echo " value=\"1\">"._("Yes")."</option>"; 68 72 ?></select></td> … … 71 75 <tr> 72 76 <th><label for="pass"><?php __("Password"); ?></label></th> 73 <td><input type="text" class="int" id="pass" name="pass" value=" <?php echo $r["pass"]; ?>" size="20" maxlength="64" /></td>77 <td><input type="text" class="int" id="pass" name="pass" value="" size="20" maxlength="64" /></td> 74 78 </tr> 75 79 <tr> … … 94 98 </tr> 95 99 <tr> 96 <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Edit this account"); ?>" /> <input type="submit" class="inb" name="back" value="<?php __("Back to the member list"); ?>" />100 <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Edit this account"); ?>" /> 97 101 </td> 98 102 </tr> … … 101 105 102 106 <p> 103 <?php 107 <?php 108 if ($mem->user[uid]==2000) { // PATCHBEN only root can change su/nosu :) 104 109 if ($r["su"]) { 105 110 ?> … … 118 123 119 124 <p><?php 125 } 120 126 $c=$admin->get($r["creator"]); 121 127 printf(_("Account created by %s"),$c["login"]); bureau/admin/adm_list.php
r108 r222 1 1 <?php 2 2 /* 3 $Id: adm_list.php,v 1. 5 2003/06/10 12:14:09 rootExp $3 $Id: adm_list.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 51 51 <p> 52 52 <?php __("Here is the list of hosted members"); ?> 53 54 <!-- TODO A supprimer en mode "on ne voit que ses comptes" + supprimer le fichier list2 --> 55 <a href="adm_list2.php">Liste de tous les comptes</a> 53 56 </p> 54 57 <p> 55 58 <a href="adm_add.php"><?php __("Create a new member"); ?></a> 56 59 </p> 60 <?php 61 if (!is_array($r)) { 62 echo "<p class=\"error\">"._("No account defined for now")."</p>"; 63 } else { 64 ?> 65 57 66 <form method="post" action="adm_dodel.php"> 58 67 <?php … … 97 106 if ($mem->user["admlist"]==1) { // Short mode TODO : make 3 columns instead of 2 + XHTML compliance instead of 1px img trick ;) 98 107 ?> 108 109 99 110 <table cellspacing="0" cellpadding="0"> 100 111 <tr> … … 102 113 <th width="1" bgcolor="black"><img src="icon/pix.gif" width="1" height="1" border="0" alt=""></th> 103 114 <th colspan="2"> </th><th><?php __("Username"); ?></th> 115 <th width="1" bgcolor="black"><img src="icon/pix.gif" width="1" height="1" border="0" alt=""></th> 116 <th colspan="2"> </th><th><?php __("Username"); ?></th> 104 117 </tr> 105 118 <?php 106 119 reset($r); 107 120 $col=1; 108 for($z=0;$z<round(count($r)/ 2);$z++)121 for($z=0;$z<round(count($r)/3);$z++) 109 122 { 110 123 $col=3-$col; … … 131 144 <td width="1" bgcolor="black"></td> 132 145 <?php 133 $val=$r[$z+round(count($r)/2)]; 134 if (is_array($val)) { 146 $val=$r[$z+round(count($r)/3)]; 135 147 ?> 136 148 <?php if ($val["su"]) { ?> … … 151 163 </td> 152 164 <td <?php if ($val["su"]) echo "style=\"color: red\""; ?>><?php echo $val["login"] ?></td> 165 <td width="1" bgcolor="black"></td> 166 <?php 167 $val=$r[$z+round(2*count($r)/3)+1]; 168 if (is_array($val)) { 169 ?> 170 <?php if ($val["su"]) { ?> 171 <td> </td> 172 <?php } else { ?> 173 <td align="center"><input type="checkbox" class="inc" name="d[]" value="<?php echo $val["uid"]; ?>"></td> 174 <?php } ?> 175 <td align="center"> 176 <a href="adm_edit.php?uid=<?php echo $val["uid"] ?>"><?php __("E"); ?></a> 177 <a href="adm_quotaedit.php?uid=<?php echo $val["uid"] ?>"><?php __("Q"); ?></a> 178 <?php 179 if (!$val["enabled"]) 180 echo "<img src=\"icon/encrypted.png\" width=\"16\" height=\"16\" alt=\""._("Locked Account")."\">"; 181 else { 182 ?> 183 <a href="adm_login.php?id=<?php echo $val["uid"];?>" target="_parent"><?php __("C"); ?></a> 184 <?php } ?> 185 </td> 186 <td <?php if ($val["su"]) echo "style=\"color: red\""; ?>><?php echo $val["login"] ?></td> 153 187 </tr> 154 188 <?php … … 162 196 </table> 163 197 </form> 164 198 <?php } ?> 165 199 </body> 166 200 </html> bureau/admin/adm_login.php
r108 r222 1 1 <?php 2 2 /* 3 $Id: adm_login.php,v 1. 2 2003/06/10 12:14:09 rootExp $3 $Id: adm_login.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 34 34 exit(); 35 35 } 36 /* 37 if (!$admin->checkcreator($uid)) { 38 __("This page is restricted to authorized staff"); 39 exit(); 40 } 41 */ 36 42 37 43 if (!$r=$admin->get($id)) { 38 44 $error=$err->errstr(); 39 45 } else { 40 $username=$r["login"]; 41 $password=$r["pass"]; 42 include("login.php"); 46 47 if (!$mem->setid($id)) { 48 $error=$err->errstr(); 49 include("index.php"); 43 50 exit(); 51 } 52 53 ?> 54 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 55 <html> 56 <head> 57 <title><?php __("AlternC Desktop"); ?></title> 58 <link rel="stylesheet" href="styles/style.css" type="text/css" /> 59 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 60 </head> 61 <frameset cols="225px,*"> 62 <frame src="menu.php" name="left" /> 63 <frame src="main.php" name="right" /> 64 <noframes> 65 <body> 66 <p> 67 Votre navigateur doit supporter les cadres.<br /> 68 Your browser must support frames 69 </p> 70 </body> 71 </noframes> 72 </frameset> 73 </html> 74 <?php 75 exit(); 44 76 } 45 77 include("head.php"); bureau/admin/adm_quotadoedit.php
r1 r222 1 1 <?php 2 2 /* 3 $Id: adm_quotadoedit.php,v 1. 1.1.1 2003/03/26 17:41:29 rootExp $3 $Id: adm_quotadoedit.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 36 36 37 37 if ($submit) { 38 39 $mem->su($uid); 38 40 $qlist=$quota->qlist(); 39 41 reset($qlist); … … 41 43 while (list($key,$val)=each($qlist)) { 42 44 $var="q_".$key; 43 $quota->setquota($key,$$var,0 ,$uid);45 $quota->setquota($key,$$var,0); 44 46 } 47 $mem->unsu(); 45 48 $error=_("The quotas has been successfully edited"); 46 49 include("adm_list.php"); … … 50 53 51 54 if ($recalc) { 52 $quota->checkquota($uid); 55 $mem->su($uid); 56 $quota->checkquota(); 57 $mem->unsu(); 53 58 include("adm_quotaedit.php"); 54 59 } bureau/admin/adm_quotaedit.php
r108 r222 1 1 <?php 2 2 /* 3 $Id: adm_quotaedit.php,v 1. 2 2003/06/10 12:14:09 rootExp $3 $Id: adm_quotaedit.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 39 39 } 40 40 41 if (!$r=$quota->getquota("",$uid)) { 41 $mem->su($uid); 42 if (!$r=$quota->getquota()) { 42 43 $error=$err->errstr(); 43 44 } 45 $mem->unsu(); 44 46 include("head.php"); 45 47 ?> bureau/admin/bro_main.php
r185 r222 1 1 <?php 2 2 /* 3 $Id: bro_main.php,v 1. 9 2004/04/30 21:05:58 anonymousExp $3 $Id: bro_main.php,v 1.10 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 173 173 echo "\">".$c[$i]["name"]."</a></td>\n"; 174 174 echo " <td>".format_size($c[$i]["size"])."</td>"; 175 #echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d H:i:s",$c[$i]["date"]))."<br /></td>"; 176 echo "<td>".date("d/m/Y H:i",$c[$i]["date"])."<br /></td>"; 177 175 echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d H:i:s",$c[$i]["date"]))."<br /></td>"; 178 176 if ($p["showtype"]) { 179 177 echo "<td>".$bro->mime($c[$i]["name"])."</td>"; … … 195 193 echo "\">".$c[$i]["name"]."/</a></b></td>\n"; 196 194 echo " <td>".format_size($c[$i]["size"])."</td>"; 197 #echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d H:i:s",$c[$i]["date"]))."<br /></td>"; 198 echo "<td>".date("d/m/Y H:i",$c[$i]["date"])."<br /></td>"; 199 195 echo "<td>".format_date('%3$d-%2$d-%1$d %4$d:%5$d',date("Y-m-d h:i:s",$c[$i]["date"]))."<br /></td>"; 200 196 if ($p["showtype"]) { 201 197 echo "<td>Dossier</td>"; bureau/admin/index.php
r135 r222 1 1 <?php 2 2 /* 3 $Id: index.php,v 1. 8 2003/08/13 23:52:24 rootExp $3 $Id: index.php,v 1.9 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 28 28 ---------------------------------------------------------------------- 29 29 */ 30 $nocheck="yes"; 31 require_once("../class/config .php");30 31 require_once("../class/config_nochk.php"); 32 32 33 33 if (!$mem->del_session()) { bureau/admin/main.php
r101 r222 1 1 <?php 2 2 /* 3 $Id: main.php,v 1. 2 2003/06/10 06:42:25 rootExp $3 $Id: main.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 47 47 $mem->resetlast(); 48 48 49 /* 50 <h3> 51 Le bureau AlternC de ce serveur est en travaux actuellement.<br /> 52 Il se peut que certaines parties du bureau soient inaccessibles ponctuellement.<br /> 53 Si une partie du bureau ne fonctionne pas pendant longtemps, n'hésitez pas, contactez le 54 mainteneur par mail : <a href="mailto:root@heberge.info">root@heberge.info</a> 55 </h3> 56 */ 49 57 ?> 50 58 </body> bureau/admin/mem_cm.php
r107 r222 1 1 <?php 2 2 /* 3 $Id: mem_cm.php,v 1. 3 2003/06/10 11:18:27 rootExp $3 $Id: mem_cm.php,v 1.4 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 28 28 ---------------------------------------------------------------------- 29 29 */ 30 $nocheck="yes"; 31 require_once("../class/config .php");30 31 require_once("../class/config_nochk.php"); 32 32 33 33 include("head.php"); bureau/admin/mem_cm2.php
r107 r222 1 1 <?php 2 2 /* 3 $Id: mem_cm2.php,v 1. 3 2003/06/10 11:18:27 rootExp $3 $Id: mem_cm2.php,v 1.4 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 28 28 ---------------------------------------------------------------------- 29 29 */ 30 $nocheck="yes"; 31 require_once("../class/config .php");30 31 require_once("../class/config_nochk.php"); 32 32 33 33 if (!$mem->ChangeMail2($cookie,$cle,$cuid)) { bureau/admin/menu.php
r135 r222 1 1 <?php 2 2 /* 3 $Id: menu.php,v 1. 4 2003/08/13 23:52:24 rootExp $3 $Id: menu.php,v 1.5 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 54 54 55 55 <p> <a href="http://alternc.org"><img src="alternc.png" width="109" height="62" border="0" alt="AlternC" /></a></p> 56 56 57 </body> 57 58 </html> bureau/admin/menu_adm.php
r101 r222 1 1 <?php 2 2 /* 3 $Id: menu_adm.php,v 1. 2 2003/06/10 06:42:25 rootExp $3 $Id: menu_adm.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 32 32 /* ######### SUPER-ADMIN ########## */ 33 33 /* ############################# */ 34 if ($mem->checkRight())35 { ?>36 34 37 38 <tr><td nowrap="nowrap"> 39 <a href="adm_list.php"><font color="red"><?php __("Manage the members"); ?></font></a><br /> 40 <a href="adm_panel.php"><font color="red"><?php __("Admin Control Panel"); ?></font></a><br /> 41 <a href="/admin/sql"><font color="red"><?php __("General SQL Admin"); ?></font></a><br /> 35 if ($mem->checkRight()) 36 { ?> 37 38 <tr><td nowrap> 39 <a href="adm_list.php"><font color="red"><?php __("Manage the members"); ?></font></a><br> 40 <a href="adm_panel.php"><font color="red"><?php __("Admin Control Panel"); ?></font></a><br> 41 <a href="/admin/sql"><font color="red"><?php __("General SQL Admin"); ?></font></a><br> 42 42 43 43 </td></tr> 44 44 <?php 45 }45 } 46 46 ?> bureau/admin/menu_aide.php
r101 r222 1 1 <?php 2 2 /* 3 $Id: menu_aide.php,v 1. 2 2003/06/10 06:42:25 rootExp $3 $Id: menu_aide.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 31 31 32 32 <tr><td nowrap="nowrap"> 33 <a href="http:// www.alternc.org/faq/?UtilisationAlternc" target="help"><?php __("Online help"); ?></a><br />33 <a href="http://doc.alternc.org/user/" target="help"><?php __("Online help"); ?></a><br /> 34 34 </td></tr> bureau/admin/menu_mail.php
r101 r222 1 1 <?php 2 2 /* 3 $Id: menu_mail.php,v 1. 2 2003/06/10 06:42:25 rootExp $3 $Id: menu_mail.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 45 45 <?php } ?> 46 46 </td></tr> 47 <?php } ?>47 <?php } ?> bureau/admin/menulist.txt
r139 r222 2 2 menu_mail.php 3 3 menu_ftp.php 4 menu_mailman.php5 4 menu_brouteur.php 6 5 menu_stats.php bureau/admin/plugins/procmail_builder/m_procmail.php
r102 r222 1 1 <?php 2 2 /* 3 $Id: m_procmail.php,v 1. 2 2003/06/10 06:45:19 rootExp $3 $Id: m_procmail.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 84 84 *****************************************************************************/ 85 85 function disable($user="") { 86 global $er ;86 global $err; 87 87 if (!$user) $user=$this->user; 88 88 $u=substr($user,0,1); … … 113 113 *****************************************************************************/ 114 114 function enable($user="") { 115 global $er ;115 global $err; 116 116 if (!$user) $user=$this->user; 117 117 if (!$this->_connectldap()) { … … 152 152 *****************************************************************************/ 153 153 function readrules($user="") { 154 global $er ;154 global $err; 155 155 if (!$user) $user=$this->user; 156 156 $u=substr($user,0,1); … … 200 200 *****************************************************************************/ 201 201 function writerules($res,$user="") { 202 global $er ;202 global $err; 203 203 if (!$user) $user=$this->user; 204 204 $u=substr($user,0,1); … … 208 208 } 209 209 $f=fopen("/var/alternc/mail/$u/$user/.procmailrc","wb"); 210 fputs($f,join("",file("/var/alternc/bureau/admin/plugins/procmail_builder/procmailrc.default"))); 210 fputs($f,str_replace("%%HOME%%","/var/alternc/mail/$u/$user",join("",file("/var/alternc/bureau/admin/plugins/procmail_builder/procmailrc.default")))); 211 //fputs($f,join("",file("/var/alternc/bureau/admin/plugins/procmail_builder/procmailrc.default"))); 211 212 for($i=0;$i<count($res);$i++) { 212 213 fputs($f,"# RuleType ".sprintf("%02d",$res[$i]["type"])." -- ".$res[$i]["name"]."\n"); … … 226 227 *****************************************************************************/ 227 228 function addrule($rule,$user="") { 228 global $er ;229 global $err; 229 230 if (!$user) $user=$this->user; 230 231 $u=substr($user,0,1); … … 248 249 *****************************************************************************/ 249 250 function buildrule($rulename,$crit,$crittext,$raction,$foldertogo,$emailto,$autoreplytxt,$user="") { 250 global $er ;251 global $err; 251 252 if (!$user) $user=$this->user; 252 253 $u=substr($user,0,1); … … 350 351 *****************************************************************************/ 351 352 function uprule($res,$i) { 352 global $er ;353 global $err; 353 354 $i=intval($i); 354 355 if (count($res)<$i || $i==0) { … … 367 368 *****************************************************************************/ 368 369 function downrule($res,$i) { 369 global $er ;370 global $err; 370 371 $i=intval($i); 371 372 if ((count($res)-1)<$i) { … … 378 379 return $res; 379 380 } 381 382 function myst($str) { 383 return str_replace("\\","",str_replace("<","<",str_replace(">",">",$str))); 384 } 380 385 381 386 /***************************************************************************** … … 411 416 if ($i) $s.=" et "; 412 417 if (ereg("^\\* \\^Subject\\.\\*(.*)$",$cond[$i],$t)) { 413 $s.=_("procmail_crit_0")." <code>". str_replace("\\","",$t[1])."</code>";418 $s.=_("procmail_crit_0")." <code>".$this->myst($t[1])."</code>"; 414 419 } 415 420 if (ereg("^\\* \\^From\\.\\*(.*)$",$cond[$i],$t)) { 416 $s.=_("procmail_crit_1")." <code>". str_replace("\\","",$t[1])."</code>";421 $s.=_("procmail_crit_1")." <code>".$this->myst($t[1])."</code>"; 417 422 } 418 423 if (ereg("^\\* \\^TO_\\.\\*(.*)$",$cond[$i],$t)) { 419 $s.=_("procmail_crit_2")." <code>". str_replace("\\","",$t[1])."</code>";424 $s.=_("procmail_crit_2")." <code>".$this->myst($t[1])."</code>"; 420 425 } 421 426 if (ereg("^\\* \\^List-Post: (.*)$",$cond[$i],$t)) { 422 $s.=_("procmail_crit_3")." <code>". str_replace("\\","",$t[1])."</code>";427 $s.=_("procmail_crit_3")." <code>".$this->myst($t[1])."</code>"; 423 428 } 424 429 if (ereg("^\\* \\^List-Id: (.*)$",$cond[$i],$t)) { 425 $s.=_("procmail_crit_4")." <code>". str_replace("\\","",$t[1])."</code>";430 $s.=_("procmail_crit_4")." <code>".$this->myst($t[1])."</code>"; 426 431 } 427 432 if (ereg("^\\* \\^X-Spam-Status: Yes$",$cond[$i])) { bureau/admin/sql_add.php
r186 r222 1 1 <?php 2 2 /* 3 $Id: sql_add.php,v 1. 4 2004/05/01 17:30:27 anonymousExp $3 $Id: sql_add.php,v 1.5 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 51 51 <form method="post" action="sql_doadd.php" id="main"> 52 52 <table border="1" cellspacing="0" cellpadding="4"> 53 <tr><th><label for="dbn"><?php __("Database name"); ?></label></th><td>53 <tr><th><label for="dbn"><?php __("Database"); ?></label></th><td> 54 54 <?php echo $mem->user["login"]; ?> <b>_</b> <input type="text" class="int" name="dbn" id="dbn" value="<?php echo $dbn; ?>" size="20" maxlength="30" /> 55 55 </td></tr> bureau/class/config.php
r61 r222 1 1 <?php 2 2 /* 3 $Id: config.php,v 1. 5 2003/05/01 11:37:38benjamin Exp $3 $Id: config.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 29 29 */ 30 30 31 /* Toutes les pages du bureau passent ici. On utilise une sémaphore pour 32 s'assurer que personne ne pourra accéder à 2 pages du bureau en même temps. 33 */ 34 // 1. Get a semaphore id for the alternc magic number (18577) 35 $alternc_sem = sem_get ( 18577 ); 36 // 2. Declare the shutdown function, that release the semaphore 37 function alternc_shutdown() { 38 global $alternc_sem; 39 sem_release( $alternc_sem ); 40 } 41 // 3. Register the shutdown function 42 register_shutdown_function("alternc_shutdown"); 43 // 4. Acquire the semaphore : with that process, 44 sem_acquire( $alternc_sem ); 45 46 47 48 /* PHPLIB inclusions : */ 49 $root="/var/alternc/bureau/"; 50 /* Server Domain Name */ 51 $host=getenv("HTTP_HOST"); 52 53 /* Global variables (AlternC configuration) */ 54 require_once($root."class/local.php"); 55 56 require_once($root."class/db_mysql.php"); 57 require_once($root."class/functions.php"); 58 59 // Classe héritée de la classe db de la phplib. 60 class DB_system extends DB_Sql { 61 var $Host,$Database,$User,$Password; 62 function DB_system() { 63 global $L_MYSQL_HOST,$L_MYSQL_DATABASE,$L_MYSQL_LOGIN,$L_MYSQL_PWD; 64 $this->Host = $L_MYSQL_HOST; 65 $this->Database = $L_MYSQL_DATABASE; 66 $this->User = $L_MYSQL_LOGIN; 67 $this->Password = $L_MYSQL_PWD; 68 } 69 } 70 71 $db= new DB_system(); 72 73 $classes=array(); 74 /* CLASSES PHP4 : automatic include : */ 75 $c=opendir($root."class/"); 76 while ($di=readdir($c)) { 77 if (ereg("^m_(.*)\\.php$",$di,$match)) { // $ 78 $name1="m_".$match[1]; 79 $name2=$match[1]; 80 $classes[]=$name2; 81 require_once($root."class/".$name1.".php"); 82 } 83 } 84 closedir($c); 85 /* THE DEFAULT CLASSES ARE : 86 dom, ftp, mail, quota, bro, admin, mem, mysql, err 87 */ 88 89 90 /* Language */ 91 bindtextdomain("alternc", "/var/alternc/bureau/locales"); 92 93 if (!$do_not_set_lang_env) { 94 // setlang is on the link at the login page 95 if ($setlang) { 96 $lang=$setlang; 97 } 98 // default language (can be changed here) 99 $language="fr_FR"; 100 if (!$lang) { 101 // Use the browser first preferred language 102 $lang=strtolower(substr(trim($HTTP_ACCEPT_LANGUAGE),0,5)); 103 } 104 // treat special cases such as en_UK or fr_BF : 105 if (substr($lang,0,2)=="en") { 106 $language ='en_US'; 107 } 108 if (substr($lang,0,2)=="fr") { 109 $language ='fr_FR'; 110 } 111 if (substr($lang,0,5)=="fr_LU") { 112 $language ='fr_LU'; 113 } 114 if (substr($lang,0,2)=="es") { 115 $language ='es_ES'; 116 } 117 if ($setlang && $language) { 118 setcookie("lang",$lang); 119 } 120 /* Language*/ 121 putenv("LC_MESSAGES=$language"); 122 putenv("LANG=$language"); 123 putenv("LANGUAGE=$language"); 124 // this locale MUST be selected in "dpkg-reconfigure locales" 125 setlocale(LC_ALL,$language); 126 textdomain("alternc"); 127 } 128 129 $mem=new m_mem(); 130 $err=new m_err(); 131 132 /* Check the User identity (if required) */ 133 if (!$nocheck) { 134 if (!$mem->checkid()) { 135 $error=$err->errstr(); 136 include("index.php"); 137 exit(); 138 } 139 } 140 141 for($i=0;$i<count($classes);$i++) { 142 if ($classes[$i]!="mem" && $classes[$i]!="err") { 143 $name2=$classes[$i]; 144 $name1="m_".$name2; 145 $$name2= new $name1($mem->uid); 146 } 147 } 148 31 $nocheck=0; 32 require_once("config_real.php"); 149 33 150 34 ?> bureau/class/functions.php
r168 r222 1 1 <?php 2 2 /* 3 $Id: functions.php,v 1. 5 2004/02/10 00:28:02 remiExp $3 $Id: functions.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 AlternC - Web Hosting System … … 127 127 /* Check a login mail */ 128 128 function checkloginmail($mail) { 129 if (!ereg("^[a-zA-Z0-9_.:- \+]+$",$mail)) {129 if (!ereg("^[a-zA-Z0-9_.:-]+$",$mail)) { 130 130 return false; 131 131 } else { … … 286 286 } 287 287 288 /* ----------------------------------------------------------------- */ 289 /** Crypte un mot de passe en clair en MD5 avec un salt aléatoire 290 * @param string $pass Mot de passe à crypter (max 32 caractères) 291 * @return string Retourne le mot de passe crypté 292 * @access private 293 */ 294 function _md5cr($pass,$salt="") { 295 if (!$salt) { 296 $chars="./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 297 for ($i=0;$i<12;$i++) { 298 $salt.=substr($chars,(mt_rand(0,strlen($chars))),1); 299 } 300 $salt="$1$".$salt; 301 } 302 return crypt($pass,$salt); 303 } 304 305 288 306 ?> bureau/class/m_admin.php
r153 r222 1 1 <?php 2 2 /* 3 $Id: m_admin.php,v 1. 5 2003/09/20 19:41:08 rootExp $3 $Id: m_admin.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 4 4 ---------------------------------------------------------------------- 5 5 LICENSE … … 36 36 /* ----------------------------------------------------------------- */ 37 37 /** 38 * $uid contient l'uid du membre actuellement connecté.39 */40 var $uid=0;41 42 /* ----------------------------------------------------------------- */43 /**44 38 * $enabled précise si l'utilisateur actuellement connecté est super-admin ou non 45 39 */ … … 67 61 * Constructeur 68 62 */ 69 function m_admin($membre=0) { 70 global $db; 71 $this->uid=$membre; 72 $db->query("SELECT su FROM membres WHERE uid=".$this->uid.";"); 63 function m_admin() { 64 global $db,$cuid; 65 $db->query("SELECT su FROM membres WHERE uid='$cuid';"); 73 66 $db->next_record(); 74 67 $this->enabled=$db->f("su"); … … 88 81 function get($uid) { 89 82 global $err,$db; 90 $err->log("admin","get",$uid);83 // $err->log("admin","get",$uid); 91 84 if (!$this->enabled) { 92 85 $err->raise("admin",1); 93 86 return false; 94 87 } 95 $db->query("SELECT * FROM membres WHERE uid= $uid;");88 $db->query("SELECT * FROM membres WHERE uid='$uid';"); 96 89 if ($db->num_rows()) { 97 90 $db->next_record(); … … 101 94 return false; 102 95 } 103 $db->query("SELECT * FROM local WHERE uid= $uid;");96 $db->query("SELECT * FROM local WHERE uid='$uid';"); 104 97 if ($db->num_rows()) { 105 98 $db->next_record(); … … 134 127 * 135 128 */ 136 function get_list() { 137 global $err; 129 function get_list($all=0) { 130 // PATCHBEN pour ne voir que les comptes que l'on a créé (sauf root) 131 global $err,$mem,$cuid; 138 132 $err->log("admin","get_list"); 139 133 if (!$this->enabled) { … &hell
