Exemple #1
0
 public static function post_createUser($parameters)
 {
     $uid = $parameters['uid'];
     $samlBackend = new OC_USER_SAML();
     if (!$samlBackend->updateUserData) {
         // Ensure that user data will be filled atleast once
         $attrs = get_user_attributes($uid, $samlBackend);
         update_user_data($uid, $attrs, true);
     }
 }
        if (empty($value) && in_array($key, $required_fields) === true) {
            $errors[] = '<div class="alert alert-danger">Fields marked with * are required.</div>';
            break 1;
        }
    }
    if (empty($errros)) {
        if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
            $errors[] = '<div class="alert alert-danger">Invalid email, please insert your correct email address.</div>';
        } else {
            if (email_exists($_POST['email']) && $_POST['email'] !== $user_data['email']) {
                $errors[] = '<div class="alert alert-danger">The email you entered \'' . $_POST['email'] . '\' is already in use.</div>';
            }
        }
        if (empty($errros)) {
            $update_data = array('first_name' => $_POST['first_name'], 'last_name' => $_POST['last_name'], 'email' => $_POST['email']);
            update_user_data($update_data, $session_user_id);
            //Redirect
            header('Location: settings.php?success');
            //email($_POST['email'], $hash);
            exit;
        }
    }
}
include 'includes/overall/header.php';
?>

		<div class="col-sm-9">
			
            <h1>Account Settings</h1>
			<div><?php 
echo output_err($errors);