Ejemplo n.º 1
0
 function GetUsers()
 {
     global $MDL, $GV;
     $MDL->Load("smadbis");
     $BILL = new CBilling($GV["dbhost"], $GV["dbname"], $GV["dblogin"], $GV["dbpassword"]);
     $vars = $BILL->GetUsers();
     if (!$vars) {
         return NULL;
     }
     include $this->groups_file;
     for ($i = 0; $i < count($vars); $i++) {
         // echo($vars[$i]["user"]."<br>");
         $user[$i]['id'] = $vars[$i]["uid"];
         $user[$i]["uid"] = $vars[$i]["uid"];
         $user[$i]["user"] = $vars[$i]["user"];
         $user[$i]["gid"] = $vars[$i]["gid"];
         $user[$i]["fio"] = $vars[$i]["fio"];
         $user[$i]["nick"] = $vars[$i]["nick"];
         $user[$i]["phone"] = $vars[$i]["phone"];
         $user[$i]["address"] = $vars[$i]["address"];
         $user[$i]["prim"] = $vars[$i]["prim"];
         $user[$i]["password"] = $vars[$i]["password"];
         $user[$i]["add_uid"] = $vars[$i]["add_uid"];
         $user[$i]["gender"] = $vars[$i]["gender"];
         $user[$i]["group"] = $vars[$i]["group"];
         $user[$i]["email"] = $vars[$i]["email"];
         $user[$i]["icq"] = $vars[$i]["icq"];
         $user[$i]["url"] = $vars[$i]["url"];
         $user[$i]["rang"] = $vars[$i]["rang"];
         $user[$i]["group"] = $vars[$i]["group"];
         $user[$i]["city"] = $vars[$i]["city"];
         $user[$i]["country"] = $vars[$i]["country"];
         $user[$i]["raiting"] = $vars[$i]["raiting"];
         $user[$i]["signature"] = $vars[$i]["signature"];
         $user[$i]["info"] = $vars[$i]["info"];
         $user[$i]["add_date"] = $vars[$i]["add_date"];
         $user[$i]["expired"] = $vars[$i]["expired"];
         $user[$i]["crypt_method"] = $vars[$i]["crypt_method"];
         $user[$i]['id'] = $vars[$i]["uid"];
         $user[$i]['login'] = $vars[$i]["user"];
         $user[$i]['passwd'] = $vars[$i]["password"];
         $user[$i]['nick'] = $vars[$i]["nick"];
         $user[$i]['gender'] = $vars[$i]["gender"];
         $user[$i]['email'] = $vars[$i]["email"];
         $user[$i]['url'] = $vars[$i]["url"];
         $user[$i]['icq'] = $vars[$i]["icq"];
         $user[$i]['regdate'] = strtotime($vars[$i]["add_date"]);
         $user[$i]['rang'] = $vars[$i]["rang"];
         $user[$i]['group'] = $vars[$i]["group"];
         $user[$i]['raiting'] = $vars[$i]["raiting"];
         $user[$i]['country'] = $vars[$i]["country"];
         $user[$i]['city'] = $vars[$i]["city"];
         $user[$i]['signature'] = $vars[$i]["signature"];
         $user[$i]["info"] = $vars[$i]["info"];
         $user[$i]["fio"] = $vars[$i]["fio"];
         $user[$i]["gid"] = $vars[$i]["gid"];
         $user[$i]["packet"] = $vars[$i]["packet"];
         $user[$i]["level"] = $GROUPS[$user[$i]['group']]["level"];
     }
     return $user;
     /*$user_files=array();
       $user_files=read_dir($this->data_dir);
       $users=array(array());
       for($i=0;$i<count($user_files);$i++)
         {
           $id=$user_files[$i];
           $file=file($this->data_dir."/".$id);
           $file=implode("",$file);
           $vars=explode($this->chr1,$file);
           $users[$i]['id']=                 $id;
           $users[$i]['login']=              $vars[0];
           $users[$i]['passwd']=             $vars[1];
           $users[$i]['nick']=               $vars[2];
           $users[$i]['gender']=             $vars[3];
           $users[$i]['email']=              $vars[4];
           $users[$i]['url']=                $vars[5];
           $users[$i]['icq']=                $vars[6];
           $users[$i]['regdate']=            $vars[7];
           $users[$i]['rang']=               $vars[8];
           $users[$i]['group']=              $vars[9];
           $users[$i]['raiting']=            $vars[10];
           $users[$i]['country']=            $vars[12];
           $users[$i]['city']=               $vars[13];
           $users[$i]['signature']=          $vars[14];
           $users[$i]["info"]=               $vars[15];
         }
       return $users; */
 }