예제 #1
0
     //			"C":"57d15a8afbc1ae08103bd991d387ddfd8d26824276476fe709d754f098b6c26d",
     //			"s":"d6735fc0486f391c4f3c947928f9e61a2418e7bed2bc9b25bb43f93acc52f636",
     //			"v":"540c2ebbf941a481b6b2c9026c07fb46e8202e4408ed96864a696deb622baece",
     //			"version":"0.2"
     //		},
     //		"oneTimePasswords":{
     //			"923cdc61c4b877b263236124c44d69b459d240453a461cce8ddf7518b423ca94": "1HD6Ta0xsifEDhDwE....9WDK6tvrS6w==",
     //			"fb1573cb9497652a81688a099a524fb116e604c6fbc191cf33406eb8438efa5f": "CocN0cSxLmMRdgNF9....o3xhGUEY68Q=="
     //		}
     //	}
     //}
     $user = new user();
     $user->Get($_SESSION["userId"]);
     $otp = new onetimepassword();
     updateUserCredentials($parameters["parameters"]["credentials"], $user);
     updateUserData($parameters["parameters"]["user"], $user);
     $otpList = $parameters["parameters"]["oneTimePasswords"];
     foreach ($otpList as $otpReference => $otpData) {
         $otpList = $otp->GetList(array(array("reference", "=", $otpReference)));
         $currentOtp = $otpList[0];
         $currentOtp->data = $otpData;
         $currentOtp->Save();
     }
     $user->Save();
     $result["lock"] = $user->lock;
     $result["result"] = "done";
     //=============================================================
 } else {
     if ($message == "echo") {
         $result["result"] = $parameters;
     }
예제 #2
0
         $base_lang = filter_input(INPUT_POST, 'base_lang', FILTER_SANITIZE_STRING);
     } else {
         $error['base'] = 1;
     }
     if (isset($_POST['base_learn_lang']) && !empty($_POST['base_learn_lang'])) {
         $base_learn_lang = filter_input(INPUT_POST, 'base_learn_lang', FILTER_SANITIZE_STRING);
     } else {
         $error['learn'] = 1;
     }
     if (isset($newsletter)) {
         $news = 1;
     } else {
         $news = 0;
     }
     if (empty($error)) {
         $update = updateUserData($db, $base_lang, $base_learn_lang, $news, $_SESSION['user_id']);
         if ($update) {
             $_SESSION['base_learn_lang'] = $base_learn_lang;
             header('Location: ' . createUrl(array("action" => "profile", "do" => "success")));
         }
     }
 }
 // EDITMAIL-Formular
 if (isset($do) && $do === 'editmail') {
     if (isset($_POST['user_mail']) && !empty($_POST['user_mail'])) {
         $mail = filter_input(INPUT_POST, 'user_mail', FILTER_VALIDATE_EMAIL);
         if (!$mail) {
             // Fehlernachricht, dem Fehlerarray hinzugefügt
             // dafür assoziativen Index "email" gesetzt (zur Zuordnung)
             $error['email'] = 'Dies ist keine gültige E-Mail Adresse.';
         }
예제 #3
0
파일: utils.php 프로젝트: gw-acadtech/VCL
function getUserInfo($id)
{
    $affilid = DEFAULT_AFFILID;
    if (!is_numeric($id)) {
        getAffilidAndLogin($id, $affilid);
    }
    $user = array();
    $query = "SELECT u.unityid AS unityid, " . "u.affiliationid, " . "af.name AS affiliation, " . "u.firstname AS firstname, " . "u.lastname AS lastname, " . "u.preferredname AS preferredname, " . "u.email AS email, " . "u.emailnotices, " . "i.name AS IMtype, " . "u.IMid AS IMid, " . "u.id AS id, " . "a.name AS adminlevel, " . "a.id AS adminlevelid, " . "u.width AS width, " . "u.height AS height, " . "u.bpp AS bpp, " . "u.audiomode AS audiomode, " . "u.mapdrives AS mapdrives, " . "u.mapprinters AS mapprinters, " . "u.mapserial AS mapserial, " . "u.showallgroups, " . "u.lastupdated AS lastupdated, " . "af.shibonly " . "FROM user u, " . "IMtype i, " . "affiliation af, " . "adminlevel a " . "WHERE u.IMtypeid = i.id AND " . "u.adminlevelid = a.id AND " . "u.affiliationid = af.id AND ";
    if (is_numeric($id)) {
        $query .= "u.id = {$id}";
    } else {
        $query .= "u.unityid = '{$id}' AND af.id = {$affilid}";
    }
    $qh = doQuery($query, "105");
    if ($user = mysql_fetch_assoc($qh)) {
        if (datetimeToUnix($user["lastupdated"]) > time() - SECINDAY || $user['unityid'] == 'vclreload' || $user['affiliation'] == 'Local' || $user['shibonly']) {
            # get user's groups
            $user["groups"] = getUsersGroups($user["id"], 1);
            checkExpiredDemoUser($user['id'], $user['groups']);
            # get user's privileges
            $user["privileges"] = getOverallUserPrivs($user["id"]);
            if (preg_match('/@/', $user['unityid'])) {
                $tmparr = explode('@', $user['unityid']);
                $user['login'] = $tmparr[0];
            } else {
                $user['login'] = $user['unityid'];
            }
            return $user;
        }
    }
    if (is_numeric($id)) {
        return updateUserData($id, "numeric");
    }
    return updateUserData($id, "loginid", $affilid);
}
예제 #4
0
function getUserInfo($id, $noupdate = 0, $numeric = 0)
{
    $affilid = DEFAULT_AFFILID;
    if (!$numeric) {
        $rc = getAffilidAndLogin($id, $affilid);
        if ($rc == -1) {
            return NULL;
        }
    }
    $user = array();
    $query = "SELECT u.unityid AS unityid, " . "u.affiliationid, " . "af.name AS affiliation, " . "u.firstname AS firstname, " . "u.lastname AS lastname, " . "u.preferredname AS preferredname, " . "u.email AS email, " . "u.emailnotices, " . "i.name AS IMtype, " . "u.IMid AS IMid, " . "u.id AS id, " . "u.width AS width, " . "u.height AS height, " . "u.bpp AS bpp, " . "u.audiomode AS audiomode, " . "u.mapdrives AS mapdrives, " . "u.mapprinters AS mapprinters, " . "u.mapserial AS mapserial, " . "COALESCE(u.rdpport, 3389) AS rdpport, " . "u.showallgroups, " . "u.lastupdated AS lastupdated, " . "u.usepublickeys, " . "u.sshpublickeys, " . "af.shibonly " . "FROM user u, " . "IMtype i, " . "affiliation af " . "WHERE u.IMtypeid = i.id AND " . "u.affiliationid = af.id AND ";
    if ($numeric) {
        $query .= "u.id = {$id}";
    } else {
        $query .= "u.unityid = '{$id}' AND af.id = {$affilid}";
    }
    $qh = doQuery($query, "105");
    if ($user = mysql_fetch_assoc($qh)) {
        $user['sshpublickeys'] = htmlspecialchars($user['sshpublickeys']);
        if (datetimeToUnix($user["lastupdated"]) > time() - SECINDAY || $user['unityid'] == 'vclreload' || $user['affiliation'] == 'Local' || $user['shibonly'] || $noupdate) {
            # get user's groups
            $user["groups"] = getUsersGroups($user["id"], 1);
            $user["groupperms"] = getUsersGroupPerms(array_keys($user['groups']));
            checkExpiredDemoUser($user['id'], $user['groups']);
            # get user's privileges
            $user["privileges"] = getOverallUserPrivs($user["id"]);
            if (preg_match('/@/', $user['unityid'])) {
                $tmparr = explode('@', $user['unityid']);
                $user['login'] = $tmparr[0];
            } else {
                $user['login'] = $user['unityid'];
            }
            $blockids = getBlockAllocationIDs($user);
            $user['memberCurrentBlock'] = count($blockids);
            return $user;
        }
    }
    if ($numeric) {
        $user = updateUserData($id, "numeric");
    } else {
        $user = updateUserData($id, "loginid", $affilid);
    }
    if (!is_null($user)) {
        $blockids = getBlockAllocationIDs($user);
        $user['memberCurrentBlock'] = count($blockids);
    }
    return $user;
}
예제 #5
0
파일: index.php 프로젝트: shmilycode/weiqi
function handleUpdateUserData($data)
{
    $uid = $data['userId'];
    $result = queryUid($uid);
    if (!$result) {
        $Response['error'] = 'error';
        $Response['message'] = '用户不存在';
        return;
    }
    while ($row = mysql_fetch_array($result)) {
        $name = $data['name'];
        $email = $data['email'];
        $sameEmail = queryEmail($email);
        if (mysql_num_rows($sameEmail)) {
            while ($row = mysql_fetch_array($sameEmail)) {
                if ($row['uid'] != $uid) {
                    $Response['status'] = 'failed';
                    $Response['message'] = '邮箱已被注册';
                    return $Response;
                }
            }
        }
        $phoneNumber = implode(' ', $data['phoneNumber']);
        $education = $data['education'];
        $eduDate = $data['eduDate'];
        $address = $data['address'];
        $res = updateUserData($uid, $name, $email, $phoneNumber, $education, $eduDate, $address);
        if (!$res) {
            $Response['status'] = 'success';
            $Response['message'] = '更新数据成功';
        } else {
            $Response['status'] = 'error';
            $Response['message'] = $res;
        }
        return $Response;
    }
}
예제 #6
0
<?php

include '../../settings.php';
include '../../inc/login_functions.php';
include '../../inc/helper.php';
include 'functions.php';
$logedIn = access($mysqli);
$userData = getUserData($mysqli, $_SESSION['userId']);
$adress = getAdress($mysqli, $_SESSION['userId']);
$updateEmail = updateEmail($mysqli, $_SESSION['userId']);
$updateData = updateUserData($mysqli, $_SESSION['userId'], $userData['email']);
$updatePassword = updatePassword($mysqli, $_SESSION['userId']);
if ($updateData == 1 || $updatePassword == 1 || $updateEmail == 1) {
    header("Location: ../Account/account.php");
    exit;
}
if ($updateData == 2 || $updatePassword == 2 || $updateEmail == 2) {
    header("Location: ../../404.php");
    exit;
}
include "../../inc/head.php";
?>

  <section id="Content" role="main">
      <div class="container">

          <!-- SECTION EMPHASIS 1 -->
          <!-- FULL WIDTH -->
      </div><!-- !container -->
      <div class="full-width section-emphasis-1 page-header">
          <div class="container">