VALUES (?s, ?s, ?s, '$password_encrypted', ?s, " . USER_STUDENT . ", ?s, ?s, " . DBHelper::timeAfter() . ", " . DBHelper::timeAfter(get_config('account_duration')) . ", ?s, $verified_mail, '', '')", $surname_form, $givenname_form, $uname, $email, $am, $phone, $language); if ($q1) { Database::get()->query('INSERT INTO user_ext_uid SET user_id = ?d, auth_id = ?d, uid = ?s', $q1->lastInsertID, $auth, $user_data->identifier); } } $last_id = $q1->lastInsertID; $userObj->refresh($last_id, $departments); user_hook($last_id); //fill custom profile fields process_profile_fields_data(array('uid' => $last_id, 'origin' => 'student_register')); if ($vmail) { $hmac = token_generate($uname . $email . $last_id); } $emailsubject = "$langYourReg $siteName"; $telephone = get_config('phone'); $administratorName = get_config('admin_name'); $emailhelpdesk = get_config('email_helpdesk'); $emailbody = "$langDestination $givenname_form $surname_form\n" . "$langYouAreReg $siteName $langSettings $uname\n" . "$langPass: $password\n$langAddress $siteName: " . "$urlServer\n" . ($vmail ? "\n$langMailVerificationSuccess.\n$langMailVerificationClick\n$urlServer" . "modules/auth/mail_verify.php?h=" . $hmac . "&id=" . $last_id . "\n" : "") . "$langProblem\n$langFormula\n" .
validateNode($depId, true); } } } $user->refresh(intval($u), $departments); user_hook($u); $qry = Database::get()->query("UPDATE user SET surname = ?s, givenname = ?s, username = ?s, email = ?s, status = ?d, phone = ?s, expires_at = ?t, am = ?s, verified_mail = ?d, whitelist = ?s WHERE id = ?d", $lname, $fname, $username, $email, $newstatus, $phone, $user_expires_at, $am, $verified_mail, $user_upload_whitelist, $u); //update custom profile fields $cpf_updated = process_profile_fields_data(array('uid' => $u, 'origin' => 'admin_edit_profile')); if ($qry->affectedRows > 0 || $cpf_updated === true) { Session::Messages($langSuccessfulUpdate, 'alert-info'); } else { Session::Messages($langUpdateNoChange, 'alert-warning'); } redirect_to_home_page('modules/admin/edituser.php?u=' . $u); } } else { $tool_content .= "<div class='alert alert-danger'>$langError <a href='listcours.php'>$back</a></div>"; } draw($tool_content, 3, null, $head_content);
verified_mail = ?d, date_open = " . DBHelper::timeAfter() . ", comment = ?s, lang = ?s, request_ip = ?s, " . $provider . "_uid = ?s", $givenname, $surname, $username, $usermail, $am, $department, $userphone, $verified_mail, $usercomment, $language, $_SERVER['REMOTE_ADDR'], $user_data->identifier); } else { $res = Database::get()->query("INSERT INTO user_request SET givenname = ?s, surname = ?s, username = ?s, email = ?s, am = ?s, faculty_id = ?d, phone = ?s, state = 1, status = $status, verified_mail = ?d, date_open = " . DBHelper::timeAfter() . ", comment = ?s, lang = ?s, request_ip = ?s", $givenname, $surname, $username, $usermail, $am, $department, $userphone, $verified_mail, $usercomment, $language, $_SERVER['REMOTE_ADDR']); } $request_id = $res->lastInsertID; //save custom profile fields values in pending table process_profile_fields_data(array('user_request_id' => $request_id, 'pending' => true)); // email does not need verification -> mail helpdesk if (!$email_verification_required) { //----------------------------- Email Request Message -------------------------- $dep_body = $tree->getFullPath($department); $subject = $prof ? $mailsubject : $mailsubject2; $MailMessage = $mailbody1 . $mailbody2 . "$givenname $surname\n\n" . $mailbody3 . $mailbody4 . $mailbody5 . ($prof ? $mailbody6 : $mailbody8) . "\n\n$langFaculty: $dep_body\n$langComments: $usercomment\n" . "$langAm: $am\n" . "$langProfUname: $username\n$langProfEmail : $usermail\n" . "$contactphone: $userphone\n\n\n$logo\n\n"; $emailAdministrator = get_config('email_sender'); if (!send_mail($siteName, $emailAdministrator, '', $emailhelpdesk, $subject, $MailMessage, $charset, "Reply-To: $usermail")) {
givenname = ?s, username = ?s, email = ?s, am = ?s, phone = ?s, description = ?s, email_public = ?s, phone_public = ?s, receive_mail = ?d, am_public = ?d $verified_mail_sql WHERE id = ?d", $surname_form, $givenname_form, $username_form, $email_form, $am_form, $phone_form, $desc_form, $email_public, $phone_public, $subscribe, $am_public, $uid); //fill custom profile fields process_profile_fields_data(array('uid' => $uid, 'origin' => 'edit_profile')); if ($q->affectedRows > 0 or isset($departments)) { $userObj->refresh($uid, $departments); Log::record(0, 0, LOG_PROFILE, array('uid' => intval($_SESSION['uid']), 'modifyprofile' => 1, 'username' => $username_form, 'email' => $email_form, 'am' => $am_form)); $_SESSION['uname'] = $username_form; $_SESSION['surname'] = $surname_form; $_SESSION['givenname'] = $givenname_form; $_SESSION['email'] = $email_form; Session::Messages($langProfileReg, 'alert-success'); redirect_to_home_page("main/profile/display_profile.php"); }
if ($auth_form == 1) { // eclass authentication validateNode(intval($depid), isDepartmentAdmin()); $hasher = new PasswordHash(8, false); $password_encrypted = $hasher->HashPassword($_POST['password']); } else { $password_encrypted = $auth_ids[$_POST['auth_form']]; } $uid = Database::get()->query("INSERT INTO user (surname, givenname, username, password, email, status, phone, am, registered_at, expires_at, lang, description, verified_mail, whitelist) VALUES (?s, ?s, ?s, ?s, ?s, ?d, ?s, ?s, " . DBHelper::timeAfter() . ", " . DBHelper::timeAfter(get_config('account_duration')) . ", ?s, '', ?s, '')", $surname_form, $givenname_form, $uname_form, $password_encrypted, $email_form, $pstatus, $phone_form, $am_form, $language_form, $verified_mail)->lastInsertID; $user->refresh($uid, array(intval($depid))); user_hook($uid); //process custom profile fields values process_profile_fields_data(array('uid' => $uid)); // close request if needed if (!empty($rid)) { $rid = intval($rid); Database::get()->query("UPDATE user_request set state = 2, date_closed = NOW() WHERE id = ?d", $rid); } if ($pstatus == 1) { $message = $profsuccess; $reqtype = ''; $type_message = $langAsProf; } else { $message = $usersuccess; $reqtype = '?type=user'; $type_message = '';