Changeset 1945

Show
Ignore:
Timestamp:
09/09/07 23:55:18 (1 year ago)
Author:
azerttyu
Message:

revert des commit [1944], [1939], [1933], [1925] : nouveau bureau.
On recommencera mais en patchant la branche /franck-desktop

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • alternc/trunk/bureau/class/config.php

    r1939 r1945  
    6767} 
    6868 
    69 $error = ""; 
    7069 
    7170/* PHPLIB inclusions : */ 
     
    7372/* Server Domain Name */ 
    7473$host=getenv("HTTP_HOST"); 
    75  
    76 /* Custom PHP debugger */  
    77 require_once($root."class/error_handler.php");  
    78 $queryCount = 0; 
    7974 
    8075/* Global variables (AlternC configuration) */ 
     
    8479require_once($root."class/functions.php"); 
    8580require_once($root."class/variables.php"); 
    86  
    87 $tempsDebut = microtimeFloat();  
    8881 
    8982// Redirection si appel à https://(!fqdn)/ 
     
    151144/* Check the User identity (if required) */ 
    152145if (!defined('NOCHECK')) { 
    153   $fields = array ( 
    154         "username"  => array ("request", "string", ""),  
    155         "password"  => array ("request", "string", ""),  
    156         "restrictip" => array ("request", "integer", 0),                 
    157   ); 
    158   getFields($fields);  
    159    
    160   if (!$mem->checkid($username,$password,$restrictip)) { 
     146  if (!$mem->checkid()) { 
    161147    $error=$err->errstr(); 
    162148    include("index.php"); 
  • alternc/trunk/bureau/class/functions.php

    r1925 r1945  
    396396} 
    397397 
    398 /* ---------------------- */ 
    399 /** Fonctions necessaires au nouveau bureau */ 
    400  
    401 function getFields($fields, $requestOnly = false) 
    402 { 
    403         $vars = array(); 
    404         $methodType = array ("get", "post", "request", "files"); 
    405  
    406         foreach ($fields AS $name => $options) 
    407         { 
    408                 if (in_array($options[0], $methodType) === false) 
    409                         die ("Illegal method type used for field " . $name . " : " . $options[0]); 
    410  
    411                 if ($requestOnly === true) 
    412                         $method = "_REQUEST"; 
    413                 else 
    414                         $method = "_" . strtoupper($options[0]); 
    415  
    416                 switch ($options[1]) 
    417                 { 
    418                         case "integer": 
    419  
    420                                 $vars[$name] = (isset($GLOBALS[$method][$name]) && is_numeric($GLOBALS[$method][$name]) ? intval($GLOBALS[$method][$name]) : $options[2]); 
    421                                 break; 
    422  
    423                         case "float": 
    424  
    425                                 $vars[$name] = (isset($GLOBALS[$method][$name]) && is_numeric($GLOBALS[$method][$name]) ? floatval($GLOBALS[$method][$name]) : $options[2]); 
    426                                 break; 
    427  
    428                         case "string": 
    429  
    430                                 $vars[$name] = (isset($GLOBALS[$method][$name]) ? trim($GLOBALS[$method][$name]) : $options[2]); 
    431                                 break; 
    432  
    433                         case "array": 
    434  
    435                                 $vars[$name] = (isset($GLOBALS[$method][$name]) && is_array($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]); 
    436                                 break; 
    437  
    438                         case "boolean": 
    439  
    440                                 $vars[$name] = (isset($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]); 
    441                                 break; 
    442  
    443                         case "file": 
    444  
    445                                 $vars[$name] = (isset($GLOBALS[$method][$name]) ? $GLOBALS[$method][$name] : $options[2]); 
    446                                 break; 
    447  
    448                         default: 
    449                     die ("Illegal method type used for field " . $name . " : " . $options[1]); 
    450                 } 
    451         } 
    452  
    453         // Insert into $GLOBALS 
    454         foreach ($vars AS $var => $value) 
    455                 $GLOBALS[$var] = $value; 
    456  
    457         return $vars; 
    458 } 
    459  
    460 function printVar($array) 
    461 { 
    462         echo "<pre style=\"border: 1px solid black; text-align: left; font-size: 9px\">\n"; 
    463         print_r($array); 
    464         echo "</pre>\n"; 
    465 } 
    466  
    467 function startBox($boxClass) 
    468 { 
    469         echo "<table class=\"" . $boxClass . "\">"; 
    470         echo "<tr>"; 
    471         echo "<td class=\"boxTopLeft\"></td>"; 
    472         echo "<td class=\"boxTop\"></td>"; 
    473         echo "<td class=\"boxTopRight\"></td>"; 
    474         echo "</tr>"; 
    475         echo "<tr>"; 
    476         echo "<td class=\"boxLeft\"></td>"; 
    477         echo "<td class=\"boxContent\">"; 
    478 } 
    479  
    480 function endBox() 
    481 { 
    482         echo "</td>"; 
    483         echo "<td class=\"boxRight\"></td>"; 
    484         echo "</tr>"; 
    485         echo "<tr>"; 
    486         echo "<td class=\"boxBottomLeft\"></td>"; 
    487         echo "<td class=\"boxBottom\"></td>"; 
    488         echo "<td class=\"boxBottomRight\"></td>"; 
    489         echo "</tr>"; 
    490         echo "</table>"; 
    491 } 
    492  
    493 function microtimeFloat() 
    494 { 
    495         return array_sum(explode(" ", microtime())); 
    496 } 
    497  
    498398 
    499399?> 
  • alternc/trunk/bureau/class/m_admin.php

    r1933 r1945  
    126126    return ($db->f("cnt")==1); 
    127127  } 
    128    
    129   /* ----------------------------------------------------------------- */ 
    130   /** Retourne la liste des lettres pour lesquelles un utilisateur a  
    131         * des membres  
    132         * Retourne un tableau indexé où se trouvent les lettres  
    133         * @return array Tableau de lettres ou FALSE si erreur  
    134         */  
    135   function get_letters() {  
    136     global $err,$mem,$cuid,$db;  
    137     $err->log("admin","get_letters");  
    138     if ($mem->user["uid"]==2000)  
    139         $db->query("SELECT LEFT(login,1) as letter FROM membres GROUP BY letter ORDER BY letter;");  
    140     else  
    141         $db->query("SELECT LEFT(login,1) as letter FROM membres WHERE creator='$cuid' GROUP BY letter ORDER BY letter;");  
    142         $res=array();  
    143         while($db->next_record()) {  
    144                 $res[]=$db->f("letter");  
    145         }  
    146         Return $res;  
    147   }  
    148   
    149   /* ----------------------------------------------------------------- */    
     128 
     129  /* ----------------------------------------------------------------- */ 
    150130  /** 
    151131   * Returns the list of the hosted accounts 
     
    167147   *  
    168148   */ 
    169   function get_list($all=0, $letter="") { 
     149  function get_list($all=0) { 
    170150    // PATCHBEN pour ne voir que les comptes que l'on a créé (sauf admin) 
    171151    global $err,$mem,$cuid; 
     
    176156    } 
    177157    $db=new DB_System(); 
    178         $letterQuery = "";  
    179         $db->query("SELECT uid FROM membres ORDER BY login;"); 
    180         if ($letter)  
    181         $letterQuery = "&& login LIKE '" . $letter . "%'";  
    182         if ($mem->user["uid"]==2000 || $all) {  
    183                 $db->query("SELECT uid FROM membres WHERE 1" . $letterQuery . " ORDER BY login;");  
     158    if ($mem->user[uid]==2000 || $all) { 
     159      $db->query("SELECT uid FROM membres ORDER BY login;"); 
    184160    } else { 
    185       $db->query("SELECT uid FROM membres WHERE creator='".$cuid. "'" . $letterQuery." ORDER BY login;"); 
     161      $db->query("SELECT uid FROM membres WHERE creator='".$cuid."' ORDER BY login;"); 
    186162    } 
    187163    if ($db->num_rows()) { 
     
    210186    $db->query("SELECT creator FROM membres WHERE uid='$uid';"); 
    211187    $db->next_record(); 
    212     if ($db->Record["creator"]!=$cuid) { 
     188    if ($db->Record[creator]!=$cuid) { 
    213189      $err->raise("admin",1); 
    214190      return false; 
  • alternc/trunk/bureau/class/m_mem.php

    r1939 r1945  
    162162   * @return TRUE si la session est correcte, FALSE sinon. 
    163163   */ 
    164   function checkid($username, $password, $restrictip) { 
    165     global $db,$err,$session,$cuid
     164  function checkid() { 
     165    global $db,$err,$session,$username,$password,$cuid,$restrictip
    166166    if ($username && $password) { 
    167167      return $this->login($username,$password,$restrictip); 
  • alternc/trunk/bureau/class/m_quota.php

    r1944 r1945  
    121121   * @Return the quota used and total for this ressource (or for all ressource if unspecified) 
    122122   */ 
    123   function getquota($ressource="",$force= false) { 
     123  function getquota($ressource="") { 
    124124    global $db,$err,$cuid; 
    125125    $err->log("quota","getquota",$ressource); 
    126126    $this->qlist(); // Generate the quota list. 
    127         if ($force == false && $this->quotas) {  
    128                 if ($ressource) {  
    129                         return $this->quotas[$ressource];  
    130                 } else {  
    131                         return $this->quotas;  
    132                 }  
    133         }      
    134127    $db->query("select * from quotas where uid='$cuid';"); 
    135128    if ($db->num_rows()==0) {