Esempio n. 1
0
function get_user_data($usr_id)
{
    global $MDL, $DIRS, $GV;
    if ($MDL->IsModuleExists("users")) {
        $MDL->Load("users");
        $USR = new CUsers($DIRS["users_data"], $DIRS["users_list"], $DIRS["users_private"], $DIRS["users_groups"], $DIRS["users_online"]);
        $USR->SetSeparators($GV["sep1"], $GV["sep2"]);
        if (!$USR->IsUserExistsById($usr_id)) {
            return array("nick" => $usr_id);
        }
        $data = $USR->GetUserData($usr_id);
        $data["level"] = $USR->GetUserLevel($usr_id);
        return $data;
    }
    return $usr_id;
}
Esempio n. 2
0
 //-------------------------//
 //----------EDIT-----------//
 //-------------------------//
 case "edit":
     global $MDL;
     $news_info = $news->get_news_info($id);
     $fulltext = $news->get_news_text($id);
     $author = $news_info["name"];
     if (!isset($editor)) {
         $editor = "html";
     }
     if ($MDL->IsModuleExists("users")) {
         $MDL->Load("users");
         $USR = new CUsers($DIRS["users_data"], $DIRS["users_list"], $DIRS["users_private"], $DIRS["users_groups"], $DIRS["users_online"]);
         $USR->SetSeparators($GV["sep1"], $GV["sep2"]);
         if ($USR->GetUserLevel($author) < $CURRENT_USER["level"] || $author == $CURRENT_USER["id"]) {
             $authorselect = "<select name=art style=\"width:100%\">";
             $udata = $USR->GetUsers();
             for ($j = 0; $j < count($udata); ++$j) {
                 if ($udata[$j]["id"] == $author) {
                     $sel = " selected";
                 } else {
                     $sel = "";
                 }
                 if ($USR->GetUserLevel($udata[$j]["id"]) < $CURRENT_USER["level"] || $udata[$j]["id"] == $CURRENT_USER["id"]) {
                     $authorselect .= "<option value=\"" . $udata[$j]["id"] . "\"{$sel}>" . $udata[$j]["nick"] . "</option>";
                 }
             }
             $authorselect .= "</select>";
         } else {
             $udata = $USR->GetUserData($author);
Esempio n. 3
0
           
           </td></tr>
           <?php 
                        }
                        ?>
         
         <?php 
                        for ($i = 0; $i < $ncnt; ++$i) {
                            if ($MDL->IsModuleExists("users")) {
                                $MDL->Load("users");
                                $USR = new CUsers($DIRS["users_data"], $DIRS["users_list"], $DIRS["users_private"], $DIRS["users_groups"], $DIRS["users_online"]);
                                $USR->SetSeparators($GV["sep1"], $GV["sep2"]);
                                $authorselect = "<select name=authorsnew[] style=\"width:100%\">";
                                $udata = $USR->GetUsers();
                                for ($j = 0; $j < count($udata); ++$j) {
                                    if ($USR->GetUserLevel($udata[$j]["id"]) < $CURRENT_USER["level"]) {
                                        $authorselect .= "<option value=\"" . $udata[$j]["id"] . "\">" . $udata[$j]["nick"] . "</option>";
                                    }
                                }
                                $authorselect .= "<option value=\"" . $CURRENT_USER["id"] . "\" selected>" . $CURRENT_USER["nick"] . "</option>";
                                $authorselect .= "</select>";
                            } else {
                                $authorselect = "root";
                            }
                            ?>
<tr><td class=tbl1>
           <div align=center><b>Новый идентификатор <?php 
                            OUT($i + 1);
                            ?>
*</b></div>
           <table width=100%>
Esempio n. 4
0
          </td></tr>
          <tr><td width=100%>
          <?php 
                                    OUT($udata["info"]);
                                    ?>
          </td></tr>
          <?php 
                                }
                                ?>
          </table>

        </td></tr>
        </table>
        </td></tr>
        <?php 
                                if (($CURRENT_USER["level"] > $USR->GetUserLevel($udata["id"]) || $CURRENT_USER["id"] == $udata["id"]) && $CURRENT_USER["level"] >= 5) {
                                    $MDL->Load("smadbis");
                                    $BILL = new CBilling($GV["dbhost"], $GV["dbname"], $GV["dblogin"], $GV["dbpassword"]);
                                    ?>
        <tr><td width=100%>
        <table class=tbl2 width=100%><td width=20% align=center>
        <a href="?p=smadbis&act=users&action=delete&mod=delete&ids[]=<?php 
                                    OUT($udata["id"]);
                                    ?>
">удалить</a></td><td width=20% align=center>
        <a href="?p=smadbis&act=users&action=add&mode=edit&uid=<?php 
                                    OUT($udata["id"]);
                                    ?>
">редактировать</a></td><td width=20% align=center>
        <a href="?p=smadbis&act=users&action=block&uid=<?php 
                                    OUT($udata["id"]);