Example #1
0
 public function mysql_delete()
 {
     $this->clear_object_links(User::get_mysql_table());
     $utr = UserTypeRight::from_property(array("UserType_id" => $this->id));
     foreach ($utr as $obj) {
         $obj->mysql_delete();
     }
     $this->mysql_delete_object();
 }
echo Language::string(648);
?>
:</td>
            <td><span class="tooltip spanIcon ui-icon ui-icon-help" title="<?php 
echo Language::string(678);
?>
"></span></td>
            <td class="fullWidth">
                <div class="horizontalMargin">
                    <select id = "selectUserInviteeShareDialog" class = "fullWidth ui-widget-content ui-corner-all">
                        <option value = "0">&lt;<?php 
echo Language::string(650);
?>
&gt;</option>
                        <?php 
$sql = sprintf("SELECT * FROM `%s`.`%s` WHERE `id`!='%s' ORDER BY `lastname` ASC, `firstname` ASC", Ini::$db_master_name, User::get_mysql_table(), $owner->id);
$z = mysql_query($sql);
while ($r = mysql_fetch_array($z)) {
    $user = User::from_mysql_result($r);
    ?>
                            <option value="<?php 
    echo $user->id;
    ?>
" name="<?php 
    echo $user->get_full_name();
    ?>
" institution="<?php 
    echo $user->institution_name;
    ?>
" <?php 
    echo $_POST['current_invitee_id'] == $user->id ? "selected" : "";
Example #3
0
 public function mysql_delete()
 {
     $this->clear_object_links(User::get_mysql_table());
     $this->mysql_delete_object();
 }
Example #4
0
        chown($session_dir, $name);
        chgrp($session_dir, Ini::$php_user_group);
        chmod($session_dir, 0770);
        $home_dir = "/home/{$name}";
        if (!is_dir($home_dir)) {
            mkdir($home_dir, 0750, true);
        }
        chown($home_dir, $name);
        chgrp($home_dir, Ini::$php_user_group);
        chmod($home_dir, 0750);
    }
}
//remove unused users
$sql = sprintf("SELECT * FROM `%s`", UserR::get_mysql_table());
$z = mysql_query($sql);
while ($r = mysql_fetch_array($z)) {
    $sql2 = sprintf("SELECT `id` FROM `%s` WHERE `id`=%s", User::get_mysql_table(), $r['User_id']);
    $z2 = mysql_query($sql2);
    //Concerto user doesn't exist
    if (mysql_num_rows($z2) == 0) {
        $userR = UserR::from_mysql_id($r['id']);
        //deluser
        `/usr/sbin/userdel -r {$userR->login}`;
        //delete UserR record
        $userR->mysql_delete();
    }
}
$z = mysql_query($sql);
if (mysql_num_rows($z) == 0) {
    `/usr/sbin/groupdel {$group}`;
}
<?php

/*
 Concerto Testing Platform,
 Web based adaptive testing platform utilizing R language for computing purposes.

 Copyright (C) 2011  Psychometrics Centre, Cambridge University

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
if (!isset($ini)) {
    require_once '../model/Ini.php';
    $ini = new Ini();
}
if (!isset($_POST['login']) || !isset($_POST['pass'])) {
    exit;
}
$sql = sprintf("INSERT INTO `%s` SET `login`='%s', `md5_password`='%s', superadmin=1", User::get_mysql_table(), $_POST['login'], md5($_POST['pass']));
mysql_query($sql);
                                    <option value="<?php 
    echo $workspace->db_name;
    ?>
" <?php 
    echo $current_db == $workspace->db_name ? "selected" : "";
    ?>
 ><?php 
    echo $workspace->get_formatted_name();
    ?>
</option>
                                    <?php 
}
?>
                            </optgroup>
                            <?php 
$sql = sprintf("SELECT `id` FROM `%s`.`%s` WHERE `id`!=%s ORDER BY `lastname` ASC, `firstname` ASC", Ini::$db_master_name, User::get_mysql_table(), $logged_user->id);
$z = mysql_query($sql);
while ($r = mysql_fetch_array($z)) {
    $label_added = false;
    $user = User::from_mysql_id($r[0]);
    foreach ($user->get_workspaces() as $workspace) {
        if ($logged_user->is_workspace_accessible($workspace->db_name)) {
            if (!$label_added) {
                $label_added = true;
                ?>
                                            <optgroup label="<?php 
                echo $user->get_full_name();
                ?>
">
                                                <?php 
            }
Example #7
0
 public static function superadmin_check()
 {
     $sql = sprintf("SELECT * FROM `%s` WHERE `superadmin`=1", User::get_mysql_table());
     $z = mysql_query($sql);
     if (mysql_num_rows($z) == 0) {
         return false;
     } else {
         return true;
     }
 }