Пример #1
0
         $usernew->preference_newemailkey = random_string(20);
         $usernew->preference_newemailattemptsleft = 3;
         $a->oldemail = $usernew->email = $user->email;
         $email_changed_html = print_box(get_string('auth_changingemailaddress', 'auth', $a), 'generalbox', 'notice', true);
         $email_changed_html .= print_continue("{$CFG->wwwroot}/user/view.php?id={$user->id}&course={$course->id}", true);
         $email_changed = true;
     }
 }
 $authplugin = get_auth_plugin($user->auth);
 $usernew->timemodified = time();
 $usernew->username = get_field('user', 'username', 'id', $usernew->id);
 // not in the edit form of the user
 // Added: to call calendar ws to edit user.
 if (modifyQSUser($usernew)) {
     $olduserinfo = get_record('user', 'id', $usernew->id);
     if (editUserProfile($usernew->username, $usernew)) {
         if (!update_record('user', $usernew)) {
             admin_moodlefailed_email($usernew, 'modifyUser');
             error('Error updating user record');
         }
         // pass a true $userold here
         if (!$authplugin->user_update($user, $userform->get_data(false))) {
             // auth update failed, rollback for moodle
             update_record('user', addslashes_object($user));
             error('Failed to update user data on external auth: ' . $user->auth . '. See the server logs for more details.');
         }
         //update preferences
         useredit_update_user_preference($usernew);
         //update interests
         if (!empty($CFG->usetags)) {
             useredit_update_interests($usernew, $usernew->interests);
Пример #2
0
     addModerator($option, $id, $cid, 0);
     break;
 case "showprofiles":
     showProfiles($kunena_db, $option, $order);
     break;
 case "profiles":
     showProfiles($kunena_db, $option, $order);
     break;
 case "logout":
     logout($option, $cid);
     break;
 case "deleteuser":
     deleteUser($option, $cid);
     break;
 case "userprofile":
     editUserProfile($option, $cid);
     break;
 case "userblock":
     userban($option, $cid, 1);
     break;
 case "userunblock":
     userban($option, $cid, 1);
     break;
 case "userban":
     userban($option, $cid, 0);
     break;
 case "userunban":
     userban($option, $cid, 0);
     break;
 case "trashusermessages":
     trashUserMessages($option, $cid);
Пример #3
0
     newModerator($option, $id);
     break;
 case "addmoderator":
     addModerator($option, $id, $cid, 1);
     break;
 case "removemoderator":
     addModerator($option, $id, $cid, 0);
     break;
 case "showprofiles":
     showProfiles($kunena_db, $option, $lang, $order);
     break;
 case "profiles":
     showProfiles($kunena_db, $option, $lang, $order);
     break;
 case "userprofile":
     editUserProfile($uid);
     break;
 case "showinstructions":
     showInstructions($kunena_db, $option, $lang);
     break;
 case "showCss":
     showCss($option);
     break;
 case "saveeditcss":
     $file = JRequest::getVar('file', 1);
     $csscontent = JRequest::getVar('csscontent', 1);
     saveCss($file, $csscontent, $option);
     break;
 case "instructions":
     showInstructions($kunena_db, $option, $lang);
     break;
         //deleteQSUser($usernew);
         admin_webservicefailed_email($usernew, 'addUser', $course);
     }
     /*	
     }else{
     	$usercreated = false;
     	deleteUserProfile($USER->username, $usernew);			//Added: 11.05.2010 - calendar.php
     	deleteQSUser($usernew);
     }	
     */
 } else {
     // Added: to call calendar ws to edit user.
     //Added: 12.28.2010 - quotasystem.php
     if (modifyQSUser($usernew)) {
         $olduserinfo = get_record('user', 'id', $usernew->id);
         if (editUserProfile($USER->username, $usernew)) {
             if (!update_record('user', $usernew)) {
                 admin_moodlefailed_email($usernew, 'modifyUser', $course);
                 error('Error updating user record');
             }
             // pass a true $userold here
             if (!$authplugin->user_update($user, $userform->get_data(false))) {
                 // auth update failed, rollback for moodle
                 update_record('user', addslashes_object($user));
                 error('Failed to update user data on external auth: ' . $user->auth . '. See the server logs for more details.');
             }
             //set new password if specified
             if (!empty($usernew->newpassword)) {
                 if ($authplugin->can_change_password()) {
                     if (!$authplugin->user_update_password($usernew, $usernew->newpassword)) {
                         admin_moodlefailed_email($usernew, 'modifyUserPassword', $course);
Пример #5
0
//
//    if($action == 'check_session'){
//        checkSession();
//    }
//
//    if($action == 'get_user_id'){
//        echo getUserId();
//    }
if ($action == 'book_ticket') {
    bookTicket($_GET['flight_id']);
}
if ($action == 'is_user_logged_in') {
    echo json_encode(getUserData());
}
if ($action == 'edit_user_profile') {
    editUserProfile();
}
if ($action == 'update_user_profile') {
    updateUserProfile($_GET['phone_num'], $_GET['email']);
}
if ($action == 'change_password') {
    changePassword($_GET['old_password'], $_GET['new_password']);
}
if ($action == 'get_all_flights') {
    getAdminAllFlights();
}
if ($action == 'delete_flight') {
    deleteFlight($_GET['flight_id']);
}
if ($action == 'edit_flight') {
    editFlight($_GET['flight_id'], $_GET['flight_no'], $_GET['flight_from'], $_GET['flight_to'], $_GET['departure_time'], $_GET['arrival_time'], $_GET['price'], $_GET['economy_seats'], $_GET['business_seats']);
    }
} else {
    redirect($CFG->wwwroot . '/index.php');
}
// get values from form for actions on this page
$param = new stdClass();
// Parameters: create a URL that displays the last (largest) quiz id and name. (eg. 2 Test Exam)
$records = get_records('user');
// returns more users.
$users = get_users_listing("username");
$counter = 0;
$errors = 0;
$errmessage = "";
foreach ($users as $user) {
    if ($user->username != 'admin') {
        //echo $user->username."<br/>";
        try {
            editUserProfile($USER->username, $user);
            modifyQSUser($user);
            enrollUsersAvailCourses($USER->username, $user->username);
            $counter++;
        } catch (Exception $e) {
            $errors++;
            $errmessage .= $u->username . "<br/>";
        }
    }
}
echo $counter . " user(s) accounts has been updated.<br/>";
if ($errors > 0) {
    echo "<br/><b>" . $errors . " errors have occured for the following accounts:<br/></b>" . $errmessage;
}
<?php

session_start();
require_once "../include/config.php";
require_once $basedir . "/include/functions.php";
require_once $basedir . "/include/user_functions.php";
$private_key = $config['private_key'];
$hash = isset($_POST['hash']) ? $_POST['hash'] : 0;
$public_key = isset($_POST['public']) ? $_POST['public'] : 0;
$time = isset($_POST['t']) ? $_POST['t'] : 0;
$myhash = md5($public_key . $private_key . $time);
if ($hash != $myhash) {
    echo json_encode(array('error' => 1, 'status' => 'Hash is invalid'));
    exit;
}
$bio = isset($_POST['bio']) ? $_POST['bio'] : false;
$fullname = isset($_POST['fn']) ? $_POST['fn'] : false;
$sex = isset($_POST['sex']) ? $_POST['sex'] : false;
$web = isset($_POST['web']) ? $_POST['web'] : false;
$ra = isset($_POST['ra']) ? $_POST['ra'] : false;
// remove avatar
if ($ra) {
    $_SESSION['user_pic'] = '';
}
$bool = editUserProfile($user_id, $bio, $fullname, $sex, $web, $ra);
if ($bool) {
    echo json_encode(array('error' => 0, 'status' => $bool, 'message' => $lang[344]));
    exit;
}