Exemplo n.º 1
0
 /**
  * 返回岗位日志对象
  *
  * @return Watt_Log
  */
 public static final function getGangWeiLogger()
 {
     return Watt_Log_Db::getGwLogger();
 }
Exemplo n.º 2
0
 /**
  * 循环进行 do 的处理
  * 
  */
 function dispatch()
 {
     /**
      * 因为Tq是用Post传递参数过来的,所以不能用$_GET
      */
     $do = empty($_REQUEST["do"]) ? "index" : trim($_REQUEST["do"]);
     /**
      * 这是为了兼容 do=xxx&action=yyy 的形式
      */
     $a = empty($_REQUEST["action"]) ? "" : trim($_REQUEST["action"]);
     if ($a) {
         $do .= "_" . $a;
     }
     /**
      * 获取view的type
      */
     $v = empty($_REQUEST["v"]) ? "Html" : trim($_REQUEST["v"]);
     //TQ任务LINK
     //http://testtpm.transn.net/index.php?do=if_renwu_detail&sj_id=35c55571-80bb-c18b-6078-465a87c329bd&Username=dGVzdC1wcjE=&Password=MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=&pwdway=md5
     /**
      * 获取用户名和密码进行快速登录
      */
     $accounts = '';
     $pwd = '';
     if (r('pwdway')) {
         if (!Watt_Session::getSession()->getUserId()) {
             //这个判断是为了不让TQ登录后,访问此链接时,冲掉session中[是否TQ]那个设置
             $accounts = iconv('GB2312', 'UTF-8', base64_decode(str_replace(' ', '+', r("Username"))));
             $pwd = iconv('GB2312', 'UTF-8', base64_decode(str_replace(' ', '+', r("Password"))));
         }
     } else {
         //if( r( 'login' ) == 'ok' ){
         if (r('login')) {
             /**
              * 这是为了兼容TQ的那个点击“查收我的订单”,导致Web重登录的问题。
              * @author terry
              * @version 0.1.0
              * Thu Sep 06 16:44:53 CST 2007
              */
             $accounts = '';
             $pwd = '';
         } else {
             //				if(r('yh_xiaoshou_id')){
             //					$wkh_id = r( "yh_waibukehu_id" );
             //					$yh_xiaoshou_id = r( "yh_xiaoshou_id" );
             //					$yh_xiaoshou_name = TpmYonghuPeer::getYhZhanghuByYhId($yh_xiaoshou_id);
             //					$nkh_id = TpmKehufromkehuPeer::getNkIdByWkId($wkh_id,$yh_xiaoshou_name);
             //					$accounts =  TpmYonghuPeer::getYhZhanghuByYhId($nkh_id) ;
             //					$pwd = r( "user_pw" );
             //					if($pwd==''){
             //						$pwd = r('yh_xiaoshou_id');
             //					}
             //				}else{
             $accounts = r("user_name");
             $pwd = r("user_pw");
             //}
         }
     }
     //var_dump();
     //exit;
     if ($accounts && $pwd) {
         $login_rev = 0;
         $user = TpmYonghuPeer::checkUserLogin($accounts, $pwd, $login_rev);
         if ($login_rev == TpmYonghuPeer::USER_LOGIN_OK) {
             // 用户登陆成功后如果密码安全强度不够,跳转到修改密码页提示用户设置安全的密码
             $pswdChecker = new Tpm_Passwordchecker($pwd);
             $cfgLevel = Watt_Config::getCfg('PSWD_CHECK_LEVEL');
             if ($cfgLevel == '') {
                 $cfgLevel = '0';
             }
             if ($pswdChecker->getSecurityLevel() < $cfgLevel) {
                 $_SESSION['LOW_PASSWORD'] = true;
                 //					header('Location:?do=ps_yonghu_changepwd&nosecurity=true');
                 //					exit;
             }
             Watt_Log::addLog('Login ok, accounts[' . $accounts . '],[' . session_name() . '=' . session_id() . ']', Watt_Log::LEVEL_INFO, 'LOGIN_WEB_DIRECT_LOGIN');
         } else {
             if ($login_rev == TpmYonghuPeer::USER_LOGIN_SHOUQUANOK) {
                 //授权密码登录 jute 20071220
                 Watt_Log::addLog('Authorizepwd Login ok, accounts[' . $accounts . ']', Watt_Log::LEVEL_INFO, 'LOGIN_WEB_DIRECT_LOGIN');
             }
         }
     }
     //如密码强度不够, 强制修改密码
     $superDoList = array('ps_yonghu_changepwd', 'login_logout', '');
     // 数组中的Action不在强制之列
     if (@$_SESSION['LOW_PASSWORD'] && !in_array($do, $superDoList)) {
         header('Location:?do=ps_yonghu_changepwd&nosecurity=true');
         exit;
     }
     /**
      * 除了译员和客户,只能从内部登录
      * @author terry
      * @version 0.1.0
      * Mon Mar 31 23:24:00 CST 2008
      */
     if (Watt_Session::getSession()->getUserName()) {
         if (!Watt_Util_Net::isLANIp($_SERVER['REMOTE_ADDR']) && r('do') != 'main_home') {
             if (!(Watt_Session::getSession()->getYhShifouWaibuDenglu() || Watt_Session::getSession()->getJsShifouWaibuDenglu())) {
                 echo '您没有外部访问权限,请联系企业管理员开通';
                 Watt_Session::getSession()->clearUserSessionInfo();
                 exit;
             }
         }
     }
     $i = $this->_maxToDo;
     while ($do != "" && $i-- > 0) {
         $do = $this->processDo($do, $v);
     }
     //如果是渠道代理商客户,传神客户,客户则记录日志 2007-7-9 john
     if (Watt_Session::getSession()->getRoleShortname() == "QDKH" || Watt_Session::getSession()->getRoleShortname() == "CSKH" || Watt_Session::getSession()->getRoleShortname() == "CR") {
         $accessLoger = new Watt_Log_Db('tpm_rizhi_fangwen');
         $accessLoger->log("", 0, $_REQUEST["do"]);
     }
 }