Exemplo n.º 1
0
         $error[$num_errors++] = "The e-mail length is more than 70 characters";
         break;
     case 1:
         $person = List_People('', '', $email, '', '', $bd);
         if ($person) {
             if ($person[0][0] != $account_id) {
                 $error[$num_errors++] = "This E-mail is already in use";
             }
         }
         break;
 }
 if ($_POST['new_password'] != $_POST['conf_new_password']) {
     $error[$num_errors++] = "The confirmation of the new password is not equal to the new password";
 }
 if (!empty($_POST['new_pasword'])) {
     switch (User_Validate_Password($_POST['new_passord'])) {
         case 0:
             $error[$num_errors++] = "The New Password is blank";
             break;
         case 1:
             $error[$num_errors++] = "The New Password is smaller than 6 characteres";
             break;
     }
 }
 if (empty($error)) {
     if (empty($_POST['new_password'])) {
         $new_password = '';
     } else {
         $new_password = $_POST['new_password'];
     }
     Person_Update_Profile($account_id, $dep_id, $name, $role, $email, $url, $category_id, $commentaries, $new_password, $image_enable, $bd);
Exemplo n.º 2
0
<?php

require "./inc/script_inicialization.php";
require "./inc/nrp_api.php";
$num_errors = 0;
$num_alerts = 0;
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == "Login") {
    ob_start();
    $val_id = User_Validate_Simple_Field($_REQUEST['id'], 32);
    $val_password = User_Validate_Password($_REQUEST['password'], 6);
    $user_ok = 0;
    if ($val_id && $val_password) {
        $auth_result = User_Authenticate_Password($_REQUEST['id'], $_REQUEST['password'], $bd);
        if ($auth_result == 1) {
            $user_ok = 1;
        } elseif ($auth_result == 0) {
            $error[$num_errors++] = "Wrong Password";
        } else {
            $error[$num_errors++] = "User Not Found";
        }
    } else {
        if ($val_id == 0) {
            $error[$num_errors++] = "The User ID is blank";
        } else {
            if ($val_id == -2) {
                $error[$num_errors++] = "There are invalid characters in the User ID";
            }
        }
        if ($val_password == 0) {
            $error[$num_errors++] = "The password is blank";
        } elseif ($val_password == -1) {