예제 #1
0
    # import class to form validation
    $this->vLoadClass($this->vconf['path'], "/vActions.phar/class.forms.php");
    # start new class
    $v = new forms();
    $v->classeErro = 'formPointer';
    $falha[] = $v->validatorField('passact', "Digite senha atual");
    if (!empty($_POST['pass'])) {
        $msgErro = $v->validatorEqual($_POST['pass'], $_POST['passt'], "Senhas não conferem");
        $falha[] = $v->validatorFieldSet('pass', $msgErro);
    }
    if (isset($_POST['pass']) && strlen($_POST['pass']) < 6) {
        $falha[] = $v->validatorFieldSet('pass', "+ Digite uma com 6 caracteres \n");
    }
    if (!empty($_POST['passact'])) {
        $pass = sha1(trim($_POST['passact']));
        $msgErro = $v->validatorTotalTable('vtx_system_access', "userkey='{$pass}' and id='{$enterID}' ", $this->adb) <= 0 ? "+ Senha atual invalida" : '';
        $falha[] = $v->validatorFieldSet('passact', $msgErro);
    }
    ### proced to register
    $falhas = implode("", $falha);
    $logs = strlen($falhas);
    if (strlen($falhas) > 0) {
        exit($this->vForceStop("0|" . nl2br($v->errorForm) . "|{$falhas}"));
    } else {
        $vtableF1[] = 'userkey';
        $vtablev1[] = sha1(trim($_POST['pass']));
        $inQuery = $v->tableSingleInsert('vtx_system_access', $vtableF1, $vtablev1, "id='" . $this->clearNumeric($_SESSION['vtxUser']) . "'");
        $this->vquery($inQuery);
        exit($this->vForceStop("1|Senha Atualizada com sucesso"));
    }
}
예제 #2
0
 # check pass e passtrue is equal
 if (!empty($_POST['userCode']) && isset($_SESSION['authValor'])) {
     $src = array("l", "o", "1", "g", "j");
     $dst = array("i", "0", "l", "6", "i");
     $pUserKey = str_replace($src, $dst, strtolower($_POST['userCode']));
     $pSessKey = str_replace($src, $dst, strtolower($_SESSION['authValor']));
     $msgErro = $v->validatorEqual($pSessKey, $pUserKey, $this->strPut("Código de segurança não confere"));
     $falha[] = $v->validatorFieldSet('userCode', $msgErro);
 }
 # check a valid captcha
 if (!isset($_SESSION['authValor'])) {
     $falha[] = $v->validatorFieldSet('authValor', "Chave de seguranca invalida");
 }
 # check if user mail exists
 if (!empty($_POST['userMail'])) {
     $msgErro = $v->validatorTotalTable('vtx_system_access', "mail1='{$_POST['userMail']}' ", $this->adb) <= 0 ? "+ E-mail não cadastrado " : '';
     $falha[] = $v->validatorFieldSet('userMail', $msgErro);
 }
 # check all failures
 $falhas = implode("", $falha);
 if (strlen($falhas) > 0) {
     exit($this->vForceStop("0|" . nl2br($v->errorForm) . "|{$falhas}"));
 } else {
     # prepare data
     $userKeyLog = trim($_POST['userMail']);
     $userKeyPas = sha1(trim($_POST['userPass']));
     # register from acess log
     $uconn = $this->getUserConnection();
     # data base preparemente
     $dryquery = " SELECT @UAid :=t1.id AS tids, t1.nome,t1.grupo,t1.tipo,t1.vinculo,t2.level ";
     $dryquery .= " FROM vtx_system_access AS t1 ";
예제 #3
0
if (isset($_POST['userInsert'])) {
    # import class to form validation
    $this->vLoadClass($this->vconf['path'], "/vActions.phar/class.forms.php");
    //$this->vLoadClass($this->vconf['path'],"/vActions.phar/class.images.php");
    # start new class
    $v = new forms();
    $v->classeErro = 'formPointer';
    $falha[1] = $v->validatorField('nome', "Digite o nome do técnico");
    $falha[2] = $v->validatorField('email', "Digite o e-mail");
    # check mail
    if (!empty($_POST['email'])) {
        $msgErro = $v->validatorMail('email', $this->strPut("Digite o e-mail administrativo corretamento"));
        $falha[4] = $v->validatorFieldSet('email', $msgErro);
    }
    if (!empty($_POST['email'])) {
        $msgErro = $v->validatorTotalTable('vtx_system_access', "mail1='{$_POST['email']}' and id!='{$enterID}' ", $this->adb) > 0 ? "+ E-mail já cadastrado <br />" : '';
        $falha[6] = $v->validatorFieldSet('email', $msgErro);
    }
    if (!empty($_POST['cpf'])) {
        $doc = $this->clearNumeric($_POST['cpf']);
        $msgErro = $v->validatorCPF($doc, "+ CPF Invalido");
        $falha[7] = $v->validatorFieldSet('cpf', $msgErro);
    }
    if (!empty($_POST['cpf'])) {
        $doc = $this->clearNumeric($_POST['cpf']);
        $msgErro = $v->validatorTotalTable('vtx_system_access', "cpf='{$doc}'  and id!='{$enterID}' ", $this->adb) > 0 ? "+ CPF já cadastrado <br />" : '';
        $falha[8] = $v->validatorFieldSet('cpf', $msgErro);
    }
    ### proced to register
    $falhas = implode("", $falha);
    if (strlen($falhas) > 0) {