コード例 #1
0
ファイル: edit_user.php プロジェクト: kayecandy/secudev
function edit_user()
{
    if (!is_logged_in() || !is_post_parameter_complete(array('salutation', 'gender', 'firstname', 'lastname', 'birthyear', 'birthmonth', 'birthday', 'password', 'aboutme'))) {
        Redirect('../edit_user.php');
    }
    $userDetails['salutation'] = $_POST['salutation'];
    $userDetails['firstname'] = $_POST['firstname'];
    $userDetails['lastname'] = $_POST['lastname'];
    $userDetails['gender'] = $_POST['gender'];
    $userDetails['birthdate'] = "{$_POST['birthyear']}-{$_POST['birthmonth']}-{$_POST['birthday']}";
    $userDetails['username'] = $_SESSION['user']['username'];
    $userDetails['password'] = $_POST['password'];
    $userDetails['aboutme'] = $_POST['aboutme'];
    if (is_admin()) {
        if (is_post_parameter_complete(array('accesslevel'))) {
            $userDetails['accesslevel'] = $_POST['accesslevel'];
        } else {
            Redirect('../edit_user.php');
        }
    } else {
        $userDetails['accesslevel'] = 'User';
    }
    if (EditUser($userDetails)) {
        if ($_SESSION['user']['accesslevel'] == $userDetails['accesslevel']) {
            $_SESSION['user'] = SelectUser($userDetails['username']);
            Redirect('../index.php');
        } else {
            Redirect('../landing.php/logout');
        }
    } else {
        Error('Edit Failed');
    }
}
コード例 #2
0
    $groupid = $_POST['groupid'];
    $adminclass = $_POST['adminclass'];
    $checked = $_POST['checked'];
    $styleid = $_POST['styleid'];
    AddUser($username, $password, $repassword, $groupid, $adminclass, $checked, $styleid, $logininid, $loginin);
} elseif ($enews == "EditUser") {
    $userid = $_POST['userid'];
    $username = $_POST['username'];
    $password = $_POST['password'];
    $repassword = $_POST['repassword'];
    $groupid = $_POST['groupid'];
    $adminclass = $_POST['adminclass'];
    $oldusername = $_POST['oldusername'];
    $checked = $_POST['checked'];
    $styleid = $_POST['styleid'];
    EditUser($userid, $username, $password, $repassword, $groupid, $adminclass, $oldusername, $checked, $styleid, $logininid, $loginin);
} elseif ($enews == "DelUser") {
    $userid = $_GET['userid'];
    DelUser($userid, $logininid, $loginin);
}
$page = (int) $_GET['page'];
$start = 0;
$line = 25;
//每页显示条数
$page_line = 12;
//每页显示链接数
$offset = $page * $line;
//总偏移量
$url = "<a href=ListUser.php>管理用户</a>";
//排序
$mydesc = (int) $_GET['mydesc'];
コード例 #3
0
ファイル: edit.php プロジェクト: hoannc54/WebBanHang
<?php

/**
* Created by PhpStorm.
* User: Hoan
* Date: 10/17/2015
* Time: 11:49 PM
Trang chỉnh sửa thành viên.
*/
session_start();
if (!isset($_SESSION['user'])) {
    header('location:login.php');
}
//Add các file cần thiết
require '../../configs/config.php';
require '../../libraries/connect.php';
require '../../models/user.php';
$user_id = $_GET['user_id'];
if ($_POST) {
    $data = array('username' => $_POST['username'], 'password' => empty($_POST['password']) ? null : $_POST['password'], 'fullname' => $_POST['fullname'], 'email' => $_POST['email'], 'status' => isset($_POST['status']) ? 1 : 0, 'modified' => date('Y-m-d H:i:s'));
    if (EditUser($data, $user_id) == 1) {
        echo "thanh cong";
        $_SESSION['success'] = true;
        //làm mới lại trang
        header('location:edit.php?user_id=' . $user_id);
    } else {
        echo "Cap nhat khong thanh cong";
    }
}
$user = GetUserById($user_id);
require '../../views/admin/user/v_edit.php';
コード例 #4
0
         $author = $_POST["author"];
         $title = $_POST["title"];
         $url = $_POST["url"];
         $screenshot_url = $_POST["screenshot_url"];
         EditEntry($jamNumber, $author, $title, $url, $screenshot_url);
     }
     $page = "main";
     break;
 case "saveuseredits":
     if (IsAdmin()) {
         $username = $_POST["username"];
         $isAdmin = isset($_POST["isadmin"]) ? intval($_POST["isadmin"]) : 0;
         if ($isAdmin != 0 && $isAdmin != 1) {
             die("invalid isadmin value");
         }
         EditUser($username, $isAdmin);
     }
     $page = "editusers";
     break;
 case "savenewuserpassword":
     if (IsAdmin()) {
         $username = $_POST["username"];
         $password1 = $_POST["password1"];
         $password2 = $_POST["password2"];
         EditUserPassword($username, $password1, $password2);
     }
     $page = "editusers";
     break;
 case "changepassword":
     if (IsLoggedIn()) {
         $passwordold = $_POST["passwordold"];