当前位置: 首页>>代码示例>>PHP>>正文


PHP Acl::changepass方法代码示例

本文整理汇总了PHP中Acl::changepass方法的典型用法代码示例。如果您正苦于以下问题:PHP Acl::changepass方法的具体用法?PHP Acl::changepass怎么用?PHP Acl::changepass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acl的用法示例。


在下文中一共展示了Acl::changepass方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _

        $msg = _("Passwords mismatches");
    } elseif (strlen($pass1) < $pass_length_min) {
        $msg = _("Password is long enought. The minimum is ") . $pass_length_min . _(" characters.");
    } elseif (strlen($pass1) > $pass_length_max) {
        $msg = _("Password is too long. The maximum is ") . $pass_length_max . _(" characters.");
    } elseif (!Session::pass_check_complexity($pass1)) {
        $msg = _("Password is not complex enought.");
    } elseif (count($recent_pass) > 0 && in_array(md5($pass1), $recent_pass)) {
        $msg = _("This password is recently used. Try another.");
    } elseif (count($user_list = Session::get_list($conn, "WHERE login = '" . $user . "' and pass = '" . md5($pass1) . "'")) > 0) {
        $msg = _("You must change your old password.");
    } else {
        $_SESSION['_user'] = $_SESSION['_backup_user'];
        unset($_SESSION['_backup_user']);
        if (preg_match("/pro|demo/", $conf->get_conf("ossim_server_version", FALSE))) {
            $res = Acl::changepass($conn, $user, $pass1, $current_pass);
        } else {
            $res = Session::changepass($conn, $user, $pass1, $current_pass);
        }
        if ($res > 0) {
            if (preg_match("/pro|demo/", $conf->get_conf("ossim_server_version", FALSE))) {
                Acl::changefirst($conn, $user);
            } else {
                Session::changefirst($conn, $user);
            }
            header("location:../index.php");
        } else {
            $msg = "Current password does not match";
        }
    }
}
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:first_login.php

示例2: die

if (ossim_error()) {
    die(ossim_error());
}
if ($pass1 != "") {
    /* check passwords */
    if (0 != strcmp($pass1, $pass2)) {
        $msg = _("Passwords mismatches");
    } elseif (strlen($pass1) < 5) {
        $msg = _("Minimum password length is 5 characters.");
    } elseif (count($user_list = Session::get_list($conn, "WHERE login = '" . $user . "' and pass = '" . md5($oldpass) . "'")) < 1) {
        $msg = _("Current password is not correct");
    } elseif ($pass1 == $oldpass) {
        $msg = _("You must change your old password.");
    } else {
        if (preg_match("/pro|demo/i", $conf->get_conf("ossim_server_version", FALSE))) {
            Acl::changepass($conn, $user, $pass1);
        } else {
            Session::changepass($conn, $user, $pass1);
        }
        header("location:../index.php");
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title> <?php 
echo gettext("AlienVault - " . ($opensource ? "Open Source SIM" : ($demo ? "Unified SIEM Demo" : "Unified SIEM")));
?>
 </title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:force_changepass.php

示例3: checkpass

     }
     //Modify pass
     if ($error == false) {
         if ($cw_pass1 == $cw_pass2) {
             $res = checkpass($dbconn, $current_pass, $cw_pass1, $cw_pass2, $username);
             if ($res !== true) {
                 $error = true;
                 $display_class = "customize_show";
                 $status_class = "ossim_error";
                 if (is_array($res) && !empty($res)) {
                     $info_error = is_array($info_error) ? array_merge($info_error, $res) : $res;
                 } else {
                     $info_error[] = _("Unknown error to check passwords");
                 }
             } else {
                 $result = Acl::changepass($dbconn, $username, $cw_pass1, $current_pass);
                 if ($result <= 0) {
                     $info_error[] = _("Error in the 'Current password' field (Current password does not match)");
                     $error = true;
                     $display_class = "customize_show";
                     $status_class = "ossim_error";
                 }
             }
         } else {
             $info_error[] = _("Error in 'New password' and 'Rewrite passwords' fields (Passwords mismatches)");
             $error = true;
             $display_class = "customize_show";
             $status_class = "ossim_error";
         }
     }
 }
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:customize.php


注:本文中的Acl::changepass方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。