Ejemplo n.º 1
0
    if ($email != '') {
        mysqli_stmt_bind_param($stmt_reg, 'ssss', $username, $passwd, $panels, $email);
    } else {
        mysqli_stmt_bind_param($stmt_reg, 'sss', $username, $passwd, $panels);
    }
    if (mysqli_stmt_execute($stmt_reg)) {
        $user_id = mysqli_insert_id($db_link_reg);
        $add_login_res = add_login($user_id, $username, $passwd);
        if ($add_login_res > 0) {
            $_SESSION['user'] = $user_id;
            echo $user_id;
            mysqli_stmt_close($stmt_reg);
            mysqli_close($db_link_reg);
            exit;
        } else {
            del_user($user_id);
        }
    }
    echo -2;
    mysqli_stmt_close($stmt_reg);
    mysqli_close($db_link_reg);
} else {
    echo -2;
    mysqli_close($db_link_reg);
}
function add_login($user_id, $username, $passwd)
{
    if (!($db_link = get_connection())) {
        return -1;
    }
    $sql = 'insert into login (id, username, passwd) values (?,?,?)';
Ejemplo n.º 2
0
<?php

if (!$user[perm]) {
    die(redirect_js("index.php"));
}
$ok = del_user($_GET[userID] * 1);
redirect("index.php?page=users");
Ejemplo n.º 3
0
$output .= "\r\n        </div>";
$action = isset($_GET['action']) ? $_GET['action'] : NULL;
switch ($action) {
    case "add_new":
        add_new();
        break;
    case "doadd_new":
        doadd_new();
        break;
    case "edit_user":
        edit_user();
        break;
    case "doedit_user":
        doedit_user();
        break;
    case "del_user":
        del_user();
        break;
    case "dodel_user":
        dodel_user();
        break;
    case "backup_user":
        backup_user();
        break;
    default:
        browse_users($sqlr, $sqlc);
}
unset($action);
unset($action_permission);
unset($lang_user);
require_once "footer.php";
Ejemplo n.º 4
0
 * 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 MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/base/includes/users.inc.php";
if (isset($_GET["user"])) {
    $user = urldecode($_GET["user"]);
}
if (isset($_POST["user"])) {
    $user = $_POST["user"];
}
if (isset($_POST["bdeluser"])) {
    del_user($user, $_POST["delfiles"]);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_("User %s has been successfully deleted"), $user));
    }
    header("Location: " . urlStrRedirect("base/users/index"));
    exit;
} else {
    $f = new PopupForm(_("Delete user"));
    $f->addText(sprintf(_("You will delete user <b>%s</b>."), $user));
    $cb = new CheckboxTpl("delfiles", _("Delete all user's files"));
    $f->add($cb, array("value" => ""));
    $hidden = new HiddenTpl("user");
    $f->add($hidden, array("value" => $user, "hide" => True));
    $f->addValidateButton("bdeluser");
    $f->addCancelButton("bback");
    $f->display();
Ejemplo n.º 5
0
    }
} else {
    header("Location: " . $basedir . "admin/");
}
// Delete user from application
function del_user($user_id)
{
    global $mysqli, $session_id;
    $stmt = $mysqli->prepare("DELETE FROM users WHERE id = ?");
    echo $mysqli->error;
    $stmt->bind_param("i", $user_id);
    $stmt->execute();
    $stmt->close();
}
if (isset($_GET['del'])) {
    del_user($_GET['del']);
    header("Location: " . $basedir . "admin/");
}
?>
<!DOCTYPE html>
<html>
	<head>
		<title><?php 
echo $title;
?>
 | System Status</title>
		<meta charset="utf-8">
		<meta name="author" content="Dylan Hansch">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
		<link rel="shortcut icon" content="none">
Ejemplo n.º 6
0
 {
     $stor = new Storage();
     $stor = $stor->storType(TE_STORTYPE);
     $h = $stor->make('hamster');
     $h->setProperty('id', $user_id);
     $sql_del = $h->del();
     if ($sql_del) {
         return true;
     }
     return false;
 }
 #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### #### ####
 #### Поехали ->
 //Del
 if (@$_REQUEST['act'] == "del") {
     del_user($_REQUEST['id']);
 }
 //Ban
 if (@$_REQUEST['act'] == "ban") {
     ban_user($_REQUEST['id'], $_REQUEST['time'] * 3600 * 24);
 }
 $db = get_user_list();
 echo '<p class="mes">Пользователи</p>';
 //View
 if (@$_REQUEST['act'] == 'view') {
     echo '<table border="0" cellpadding=1 cellspacing=1 valign=top >';
     foreach (get_profile($_REQUEST['id']) as $key => $value) {
         if ($key !== "password") {
             echo '
             <tr>
                     <td><p>[' . $key . '] </p></td><td><p> ' . $value . '</p></td>
Ejemplo n.º 7
0
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/right.css">
</head>
<body>
<div class="container">
	<div class="rs_head">删除测试信息</div>
</div>
<form action='' method='post'>
<table class='main main_left'>
	<?php 
if ($uid == 0) {
    ?>
	<tr>
		<td>输入要删除用户的id值:<input type='text' name='user_id' /><input type='submit' value='删除' class='top_button' /></td>
	</tr>

	<?php 
} else {
    echo del_user($dbo, $uid);
}
?>
	<tr>
		<td><input type='button' class='top_button' value='返回上级菜单' onclick='window.history.go(-1);' /></td>
	</tr>	
<table>
</form>
</body>
</html>
Ejemplo n.º 8
0
 function delete()
 {
     if ($this->deletable) {
         $login = $this->user["login"];
         del_user($login, array_key_exists("files", $this->user) ? $this->user["files"] : "on");
         $this->result = "Deleted";
     }
 }
Ejemplo n.º 9
0
require "toolsBox/clear_test/ftool_clearTestData.php";
//语言包引入
$t_langpackage = new toollp();
$dbo = new dbex();
dbtarget('w', $dbServs);
?>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/right.css">
</head>
<body>
<div class="container">
	<div class="rs_head">删除测试信息</div>
</div>
<table class='main main_left'>
	<tr>
		<td><?php 
echo del_user($dbo, '');
?>
</td>
	</tr>	
	<tr>
		<td><input type='button' class='top_button' value='返回上级菜单' onclick='window.history.go(-1);' /></td>
	</tr>
<table>
</body>
</html>			
Ejemplo n.º 10
0
$action = isset($_GET['action']) ? $_GET['action'] : NULL;
// define functions to be called by actions
if ('add_new' == $action) {
    add_new();
} else {
    if ('doadd_new' == $action) {
        doadd_new($sqlr);
    } else {
        if ('edit_user' == $action) {
            edit_user($sqlr, $sqlc);
        } else {
            if ('doedit_user' == $action) {
                doedit_user($sqlr);
            } else {
                if ('del_user' == $action) {
                    del_user($sqlr);
                } else {
                    if ('dodel_user' == $action) {
                        dodel_user($sqlr, $sqlc);
                    } else {
                        if ('backup_user' == $action) {
                            backup_user($sqlr, $sqlc);
                        } else {
                            browse_users($sqlr);
                        }
                    }
                }
            }
        }
    }
}
Ejemplo n.º 11
0
    if (!empty($_GET) && isset($_GET['page'])) {
        $page = (int) $_GET['page'];
    } else {
        $page = 1;
    }
    // Check that the page is within our bounds
    if ($page < 0) {
        $page = 1;
    } elseif ($page > $numberOfPages) {
        $page = $numberOfPages;
    }
    $users = get_users_paging($conn, $page, $countPerPage);
    include 'views/list_users.php';
} elseif (isset($_GET['del'])) {
    $where = array("id" => $_GET['del']);
    del_user($conn, $where);
    header("Location: index.php?controller=users");
    exit;
} elseif (isset($_GET['edit']) && is_numeric($_GET['edit'])) {
    //if form is submitted.
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        $where_condition = array("id" => $_GET['edit']);
        $msg = "";
        $class_stat = 'class="alert alert-info"';
        if (trim($_POST['password']) != trim($_POST['confirm_password'])) {
            $msg = "Your password does not match your confirmed password.";
            $class_stat = 'class="alert alert-warning"';
        } else {
            $_POST['password'] = md5($_POST['password']);
            unset($_POST['confirm_password']);
            $data = $_POST;
Ejemplo n.º 12
0
if ($update == 1) {
    /* Updating an existing user in the db. */
    if (!$db_name || !$pass) {
        print $error;
        exit;
    } elseif (!$name) {
        /* should never reach here. */
        print "Internal Error.  Please go back and reload the page.";
        exit;
    }
    /* 
     * check for user being in the db already.  If so drop user and
     * recreate.
     */
    if (check_user($name)) {
        del_user($name);
    }
    add_user($name, $pass);
    add_db($db_name, $name);
    $i_added = make_string_added_to_db($name, $db_name);
    print "{$i_added} {$back}";
} elseif ($name) {
    /* Adding a user to the database. */
    $userinfo = posix_getpwnam($name);
    $fname = $userinfo['gecos'];
    $uinfo = "{$name} - {$fname} ";
    $html = print_form($user_in_db, $uinfo, $name, $password_notice);
    print $html;
} else {
    print "{$welcome}";
}