Changeset 222

Show
Ignore:
Timestamp:
02/21/06 23:52:15 (3 years ago)
Author:
anarcat
Message:

[project @ alternc: changeset 2004-05-19 14:23:06 by benjamin]
Inclusion du patch de securite 01/05/2004.

Original author: benjamin
Date: 2004-05-19 14:23:06

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bureau/admin/adm_doadd.php

    r1 r222  
    11<?php 
    22/* 
    3  $Id: adm_doadd.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: adm_doadd.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    4242 
    4343  // 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  
    4748 $error=_("The new member has been successfully created"); 
    4849 
  • bureau/admin/adm_dodel.php

    r1 r222  
    11<?php 
    22/* 
    3  $Id: adm_dodel.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: adm_dodel.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3535} 
    3636 
     37 
    3738if (!is_array($d)) { 
    3839  $d[]=$d; 
     
    4142reset($d); 
    4243while (list($key,$val)=each($d)) { 
     44  if (!$admin->checkcreator($val)) { 
     45    __("This page is restricted to authorized staff"); 
     46    exit(); 
     47  } 
    4348  if (!($u=$admin->get($val)) || !$admin->del_mem($val)) { 
    4449    $error.=sprintf(_("Member '%s' does not exist"),$val)."<br />"; 
  • bureau/admin/adm_doedit.php

    r164 r222  
    11<?php 
    22/* 
    3  $Id: adm_doedit.php,v 1.2 2003/10/22 08:18:53 benjamin Exp $ 
     3 $Id: adm_doedit.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3030require_once("../class/config.php"); 
    3131 
    32 if ($back) { 
    33   include("adm_list.php"); 
    34   exit
     32if (!$admin->enabled) { 
     33  __("This page is restricted to authorized staff"); 
     34  exit()
    3535} 
    36 if (!$admin->enabled) { 
     36if (!$admin->checkcreator($uid)) { 
    3737  __("This page is restricted to authorized staff"); 
    3838  exit(); 
  • bureau/admin/adm_edit.php

    r164 r222  
    11<?php 
    22/* 
    3  $Id: adm_edit.php,v 1.7 2003/10/22 08:18:53 benjamin Exp $ 
     3 $Id: adm_edit.php,v 1.8 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3434        exit(); 
    3535} 
     36if (!$admin->checkcreator($uid)) { 
     37        __("This page is restricted to authorized staff"); 
     38        exit(); 
     39} 
    3640 
    3741if (!$r=$admin->get($uid)) { 
     
    6165        <?php 
    6266          echo "<option"; 
    63           if (!$r["enabled"]) echo " selected=\"selected\""; 
     67          if ($r["enabled"]=="0") echo " selected=\"selected\""; 
    6468          echo " value=\"0\">"._("No")."</option>"; 
    6569          echo "<option"; 
    66           if ($r["enabled"]) echo " selected=\"selected\""; 
     70          if ($r["enabled"]=="1") echo " selected=\"selected\""; 
    6771          echo " value=\"1\">"._("Yes")."</option>"; 
    6872?></select></td> 
     
    7175<tr> 
    7276        <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> 
    7478</tr> 
    7579<tr> 
     
    9498</tr> 
    9599<tr> 
    96         <td colspan="2" align="center"><input type="submit" class="inb" name="submit" value="<?php __("Edit this account"); ?>" /> &nbsp; <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"); ?>" /> 
    97101</td> 
    98102</tr> 
     
    101105 
    102106<p> 
    103 <?php  
     107<?php 
     108        if ($mem->user[uid]==2000) { // PATCHBEN only root can change su/nosu :)   
    104109if ($r["su"]) { 
    105110?> 
     
    118123 
    119124<p><?php  
     125        } 
    120126$c=$admin->get($r["creator"]); 
    121127printf(_("Account created by %s"),$c["login"]);  
  • bureau/admin/adm_list.php

    r108 r222  
    11<?php 
    22/* 
    3  $Id: adm_list.php,v 1.5 2003/06/10 12:14:09 root Exp $ 
     3 $Id: adm_list.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    5151<p> 
    5252<?php __("Here is the list of hosted members"); ?> 
     53&nbsp; 
     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> 
    5356</p> 
    5457<p> 
    5558<a href="adm_add.php"><?php __("Create a new member"); ?></a> 
    5659</p> 
     60<?php 
     61if (!is_array($r)) { 
     62  echo "<p class=\"error\">"._("No account defined for now")."</p>"; 
     63} else {  
     64?> 
     65 
    5766<form method="post" action="adm_dodel.php"> 
    5867<?php  
     
    97106if ($mem->user["admlist"]==1) { // Short mode TODO : make 3 columns instead of 2  + XHTML compliance instead of 1px img trick ;) 
    98107?> 
     108 
     109 
    99110<table cellspacing="0" cellpadding="0"> 
    100111<tr> 
     
    102113        <th width="1" bgcolor="black"><img src="icon/pix.gif" width="1" height="1" border="0" alt=""></th> 
    103114        <th colspan="2">&nbsp;</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">&nbsp;</th><th><?php __("Username"); ?></th> 
    104117</tr> 
    105118<?php 
    106119reset($r); 
    107120$col=1; 
    108 for($z=0;$z<round(count($r)/2);$z++) 
     121for($z=0;$z<round(count($r)/3);$z++) 
    109122        { 
    110123        $col=3-$col; 
     
    131144<td width="1" bgcolor="black"></td> 
    132145<?php 
    133 $val=$r[$z+round(count($r)/2)]; 
    134 if (is_array($val)) { 
     146$val=$r[$z+round(count($r)/3)]; 
    135147?> 
    136148<?php if ($val["su"]) { ?> 
     
    151163                </td> 
    152164                <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]; 
     168if (is_array($val)) { 
     169?> 
     170<?php if ($val["su"]) { ?> 
     171                        <td>&nbsp;</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> 
    153187        </tr> 
    154188<?php 
     
    162196</table> 
    163197</form> 
    164  
     198   <?php } ?> 
    165199</body> 
    166200</html> 
  • bureau/admin/adm_login.php

    r108 r222  
    11<?php 
    22/* 
    3  $Id: adm_login.php,v 1.2 2003/06/10 12:14:09 root Exp $ 
     3 $Id: adm_login.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3434        exit(); 
    3535} 
     36/* 
     37if (!$admin->checkcreator($uid)) { 
     38  __("This page is restricted to authorized staff"); 
     39  exit(); 
     40} 
     41*/ 
    3642 
    3743if (!$r=$admin->get($id)) { 
    3844        $error=$err->errstr(); 
    3945} else { 
    40         $username=$r["login"]; 
    41         $password=$r["pass"]; 
    42         include("login.php"); 
     46 
     47if (!$mem->setid($id)) { 
     48        $error=$err->errstr(); 
     49        include("index.php"); 
    4350        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(); 
    4476} 
    4577include("head.php"); 
  • bureau/admin/adm_quotadoedit.php

    r1 r222  
    11<?php 
    22/* 
    3  $Id: adm_quotadoedit.php,v 1.1.1.1 2003/03/26 17:41:29 root Exp $ 
     3 $Id: adm_quotadoedit.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3636 
    3737if ($submit) { 
     38 
     39  $mem->su($uid); 
    3840  $qlist=$quota->qlist(); 
    3941  reset($qlist); 
     
    4143  while (list($key,$val)=each($qlist)) { 
    4244    $var="q_".$key; 
    43     $quota->setquota($key,$$var,0,$uid); 
     45    $quota->setquota($key,$$var,0); 
    4446  } 
     47  $mem->unsu(); 
    4548  $error=_("The quotas has been successfully edited"); 
    4649  include("adm_list.php"); 
     
    5053 
    5154if ($recalc) { 
    52   $quota->checkquota($uid); 
     55  $mem->su($uid); 
     56  $quota->checkquota(); 
     57  $mem->unsu(); 
    5358  include("adm_quotaedit.php"); 
    5459} 
  • bureau/admin/adm_quotaedit.php

    r108 r222  
    11<?php 
    22/* 
    3  $Id: adm_quotaedit.php,v 1.2 2003/06/10 12:14:09 root Exp $ 
     3 $Id: adm_quotaedit.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3939} 
    4040 
    41 if (!$r=$quota->getquota("",$uid)) { 
     41$mem->su($uid); 
     42if (!$r=$quota->getquota()) { 
    4243        $error=$err->errstr(); 
    4344} 
     45$mem->unsu(); 
    4446include("head.php"); 
    4547?> 
  • bureau/admin/bro_main.php

    r185 r222  
    11<?php 
    22/* 
    3  $Id: bro_main.php,v 1.9 2004/04/30 21:05:58 anonymous Exp $ 
     3 $Id: bro_main.php,v 1.10 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    173173echo "\">".$c[$i]["name"]."</a></td>\n"; 
    174174echo "  <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  
     175echo "<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>"; 
    178176if ($p["showtype"]) { 
    179177echo "<td>".$bro->mime($c[$i]["name"])."</td>"; 
     
    195193echo "\">".$c[$i]["name"]."/</a></b></td>\n"; 
    196194echo "  <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  
     195echo "<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>"; 
    200196if ($p["showtype"]) { 
    201197echo "<td>Dossier</td>"; 
  • bureau/admin/index.php

    r135 r222  
    11<?php 
    22/* 
    3  $Id: index.php,v 1.8 2003/08/13 23:52:24 root Exp $ 
     3 $Id: index.php,v 1.9 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    2828 ---------------------------------------------------------------------- 
    2929*/ 
    30 $nocheck="yes"; 
    31 require_once("../class/config.php"); 
     30 
     31require_once("../class/config_nochk.php"); 
    3232 
    3333if (!$mem->del_session()) { 
  • bureau/admin/main.php

    r101 r222  
    11<?php 
    22/* 
    3  $Id: main.php,v 1.2 2003/06/10 06:42:25 root Exp $ 
     3 $Id: main.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    4747$mem->resetlast(); 
    4848 
     49/* 
     50<h3> 
     51Le bureau AlternC de ce serveur est en travaux actuellement.<br /> 
     52Il se peut que certaines parties du bureau soient inaccessibles ponctuellement.<br /> 
     53Si une partie du bureau ne fonctionne pas pendant longtemps, n'hésitez pas, contactez le  
     54mainteneur par mail : <a href="mailto:root@heberge.info">root@heberge.info</a> 
     55</h3> 
     56*/ 
    4957?> 
    5058</body> 
  • bureau/admin/mem_cm.php

    r107 r222  
    11<?php 
    22/* 
    3  $Id: mem_cm.php,v 1.3 2003/06/10 11:18:27 root Exp $ 
     3 $Id: mem_cm.php,v 1.4 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    2828 ---------------------------------------------------------------------- 
    2929*/ 
    30 $nocheck="yes"; 
    31 require_once("../class/config.php"); 
     30 
     31require_once("../class/config_nochk.php"); 
    3232 
    3333include("head.php"); 
  • bureau/admin/mem_cm2.php

    r107 r222  
    11<?php 
    22/* 
    3  $Id: mem_cm2.php,v 1.3 2003/06/10 11:18:27 root Exp $ 
     3 $Id: mem_cm2.php,v 1.4 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    2828 ---------------------------------------------------------------------- 
    2929*/ 
    30 $nocheck="yes"; 
    31 require_once("../class/config.php"); 
     30 
     31require_once("../class/config_nochk.php"); 
    3232 
    3333if (!$mem->ChangeMail2($cookie,$cle,$cuid)) { 
  • bureau/admin/menu.php

    r135 r222  
    11<?php 
    22/* 
    3  $Id: menu.php,v 1.4 2003/08/13 23:52:24 root Exp $ 
     3 $Id: menu.php,v 1.5 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    5454 
    5555<p> <a href="http://alternc.org"><img src="alternc.png" width="109" height="62" border="0" alt="AlternC" /></a></p> 
     56 
    5657</body> 
    5758</html> 
  • bureau/admin/menu_adm.php

    r101 r222  
    11<?php 
    22/* 
    3  $Id: menu_adm.php,v 1.2 2003/06/10 06:42:25 root Exp $ 
     3 $Id: menu_adm.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3232/* ######### SUPER-ADMIN ########## */ 
    3333/* ############################# */ 
    34         if ($mem->checkRight()) 
    35    {    ?> 
    3634 
    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 /> 
     35if ($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> 
    4242 
    4343</td></tr> 
    4444<?php 
    45    } 
     45           } 
    4646?> 
  • bureau/admin/menu_aide.php

    r101 r222  
    11<?php 
    22/* 
    3  $Id: menu_aide.php,v 1.2 2003/06/10 06:42:25 root Exp $ 
     3 $Id: menu_aide.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    3131 
    3232<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 /> 
    3434</td></tr> 
  • bureau/admin/menu_mail.php

    r101 r222  
    11<?php 
    22/* 
    3  $Id: menu_mail.php,v 1.2 2003/06/10 06:42:25 root Exp $ 
     3 $Id: menu_mail.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    4545<?php    }    ?> 
    4646</td></tr> 
    47 <?php    }    ?> 
     47<?php    } ?> 
  • bureau/admin/menulist.txt

    r139 r222  
    22menu_mail.php 
    33menu_ftp.php 
    4 menu_mailman.php 
    54menu_brouteur.php 
    65menu_stats.php 
  • bureau/admin/plugins/procmail_builder/m_procmail.php

    r102 r222  
    11<?php 
    22/* 
    3  $Id: m_procmail.php,v 1.2 2003/06/10 06:45:19 root Exp $ 
     3 $Id: m_procmail.php,v 1.3 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    8484*****************************************************************************/ 
    8585function disable($user="") { 
    86         global $er
     86        global $err
    8787        if (!$user) $user=$this->user; 
    8888        $u=substr($user,0,1); 
     
    113113*****************************************************************************/ 
    114114function enable($user="") { 
    115         global $er
     115        global $err
    116116        if (!$user) $user=$this->user; 
    117117        if (!$this->_connectldap()) { 
     
    152152*****************************************************************************/ 
    153153function readrules($user="") { 
    154         global $er
     154        global $err
    155155        if (!$user) $user=$this->user; 
    156156        $u=substr($user,0,1); 
     
    200200*****************************************************************************/ 
    201201function writerules($res,$user="") { 
    202         global $er
     202        global $err
    203203        if (!$user) $user=$this->user; 
    204204        $u=substr($user,0,1); 
     
    208208        } 
    209209        $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"))); 
    211212        for($i=0;$i<count($res);$i++) { 
    212213                fputs($f,"# RuleType ".sprintf("%02d",$res[$i]["type"])." -- ".$res[$i]["name"]."\n"); 
     
    226227*****************************************************************************/ 
    227228function addrule($rule,$user="") { 
    228         global $er
     229        global $err
    229230        if (!$user) $user=$this->user; 
    230231        $u=substr($user,0,1); 
     
    248249*****************************************************************************/ 
    249250function buildrule($rulename,$crit,$crittext,$raction,$foldertogo,$emailto,$autoreplytxt,$user="") { 
    250         global $er
     251        global $err
    251252        if (!$user) $user=$this->user; 
    252253        $u=substr($user,0,1); 
     
    350351*****************************************************************************/ 
    351352function uprule($res,$i) { 
    352         global $er
     353        global $err
    353354        $i=intval($i); 
    354355        if (count($res)<$i || $i==0) { 
     
    367368*****************************************************************************/ 
    368369function downrule($res,$i) { 
    369         global $er
     370        global $err
    370371        $i=intval($i); 
    371372        if ((count($res)-1)<$i) { 
     
    378379        return $res; 
    379380} 
     381 
     382 function myst($str) { 
     383   return str_replace("\\","",str_replace("<","&lt;",str_replace(">","&gt;",$str))); 
     384 } 
    380385 
    381386/***************************************************************************** 
     
    411416                if ($i) $s.=" et "; 
    412417                if (ereg("^\\* \\^Subject\\.\\*(.*)$",$cond[$i],$t)) { 
    413                         $s.=_("procmail_crit_0")."&nbsp;&nbsp;<code>".str_replace("\\","",$t[1])."</code>"; 
     418                        $s.=_("procmail_crit_0")."&nbsp;&nbsp;<code>".$this->myst($t[1])."</code>"; 
    414419                } 
    415420                if (ereg("^\\* \\^From\\.\\*(.*)$",$cond[$i],$t)) { 
    416                         $s.=_("procmail_crit_1")."&nbsp;&nbsp;<code>".str_replace("\\","",$t[1])."</code>"; 
     421                        $s.=_("procmail_crit_1")."&nbsp;&nbsp;<code>".$this->myst($t[1])."</code>"; 
    417422                } 
    418423                if (ereg("^\\* \\^TO_\\.\\*(.*)$",$cond[$i],$t)) { 
    419                         $s.=_("procmail_crit_2")."&nbsp;&nbsp;<code>".str_replace("\\","",$t[1])."</code>"; 
     424                        $s.=_("procmail_crit_2")."&nbsp;&nbsp;<code>".$this->myst($t[1])."</code>"; 
    420425                } 
    421426                if (ereg("^\\* \\^List-Post: (.*)$",$cond[$i],$t)) { 
    422                         $s.=_("procmail_crit_3")."&nbsp;&nbsp;<code>".str_replace("\\","",$t[1])."</code>"; 
     427                        $s.=_("procmail_crit_3")."&nbsp;&nbsp;<code>".$this->myst($t[1])."</code>"; 
    423428                } 
    424429                if (ereg("^\\* \\^List-Id: (.*)$",$cond[$i],$t)) { 
    425                         $s.=_("procmail_crit_4")."&nbsp;&nbsp;<code>".str_replace("\\","",$t[1])."</code>"; 
     430                        $s.=_("procmail_crit_4")."&nbsp;&nbsp;<code>".$this->myst($t[1])."</code>"; 
    426431                } 
    427432                if (ereg("^\\* \\^X-Spam-Status: Yes$",$cond[$i])) { 
  • bureau/admin/sql_add.php

    r186 r222  
    11<?php 
    22/* 
    3  $Id: sql_add.php,v 1.4 2004/05/01 17:30:27 anonymous Exp $ 
     3 $Id: sql_add.php,v 1.5 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    5151<form method="post" action="sql_doadd.php" id="main"> 
    5252<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> 
    5454        <?php echo $mem->user["login"]; ?>&nbsp;<b>_</b>&nbsp;<input type="text" class="int" name="dbn" id="dbn" value="<?php echo $dbn; ?>" size="20" maxlength="30" /> 
    5555</td></tr> 
  • bureau/class/config.php

    r61 r222  
    11<?php 
    22/* 
    3  $Id: config.php,v 1.5 2003/05/01 11:37:38 benjamin Exp $ 
     3 $Id: config.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    2929*/ 
    3030 
    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; 
     32require_once("config_real.php"); 
    14933 
    15034?> 
  • bureau/class/functions.php

    r168 r222  
    11<?php 
    22/* 
    3  $Id: functions.php,v 1.5 2004/02/10 00:28:02 remi Exp $ 
     3 $Id: functions.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 AlternC - Web Hosting System 
     
    127127/* Check a login mail */ 
    128128function checkloginmail($mail) { 
    129   if (!ereg("^[a-zA-Z0-9_.:-\+]+$",$mail)) { 
     129  if (!ereg("^[a-zA-Z0-9_.:-]+$",$mail)) { 
    130130    return false; 
    131131  } else { 
     
    286286} 
    287287 
     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 
    288306?> 
  • bureau/class/m_admin.php

    r153 r222  
    11<?php 
    22/* 
    3  $Id: m_admin.php,v 1.5 2003/09/20 19:41:08 root Exp $ 
     3 $Id: m_admin.php,v 1.6 2004/05/19 14:23:06 benjamin Exp $ 
    44 ---------------------------------------------------------------------- 
    55 LICENSE 
     
    3636  /* ----------------------------------------------------------------- */ 
    3737  /** 
    38    * $uid contient l'uid du membre actuellement connecté. 
    39    */ 
    40   var $uid=0; 
    41  
    42   /* ----------------------------------------------------------------- */ 
    43   /** 
    4438   * $enabled précise si l'utilisateur actuellement connecté est super-admin ou non 
    4539   */ 
     
    6761   * Constructeur 
    6862   */ 
    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';"); 
    7366    $db->next_record(); 
    7467    $this->enabled=$db->f("su"); 
     
    8881  function get($uid) { 
    8982    global $err,$db; 
    90     $err->log("admin","get",$uid); 
     83    //    $err->log("admin","get",$uid); 
    9184    if (!$this->enabled) { 
    9285      $err->raise("admin",1); 
    9386      return false; 
    9487    } 
    95     $db->query("SELECT * FROM membres WHERE uid=$uid;"); 
     88    $db->query("SELECT * FROM membres WHERE uid='$uid';"); 
    9689    if ($db->num_rows()) { 
    9790      $db->next_record(); 
     
    10194      return false; 
    10295    } 
    103     $db->query("SELECT * FROM local WHERE uid=$uid;"); 
     96    $db->query("SELECT * FROM local WHERE uid='$uid';"); 
    10497    if ($db->num_rows()) { 
    10598      $db->next_record(); 
     
    134127   *  
    135128   */ 
    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; 
    138132    $err->log("admin","get_list"); 
    139133    if (!$this->enabled) { 
    &hell