Exemple #1
0
 public function actionStartUp()
 {
     $username = Bd_PhpCas::isAuthenticated();
     // 如果ral/services/uuap.conf配置错误 $username 便会是false
     if ($username === false) {
         return false;
     }
     //使用UUAP SSO服务登录后会返回用户登录的账户名,此处复用USER_INFO字典用于存储
     $arrUserInfo = array('uname' => $username);
     $re = self::setUserInfo($arrUserInfo);
 }
Exemple #2
0
 /**
  * @brief 全局初始化接口
  *
  * @return  success-true failed-false 
  * @retval  boolean
  * @see getCasInit()
  * @note 这个函数修改了session的存储文件路径为/odp/data/phpcas,并关闭了phpCAS第三方库本身的日志
  * @note 在一个CGI中phpCAS client对象只能被初始化一次,因此设置$isCasClientInit属性用来控制
  * @author chenyijie
  * @date 2012/09/28 22:28:43
  **/
 private static function init()
 {
     if (self::$isCasClientInit) {
         return true;
     }
     if (!self::getCasInit()) {
         Bd_Log::warning('UUAP CAS protocol init failed');
         return false;
     }
     $link = self::$arrConf['Server'][0]['Hostname'];
     $port = self::$arrConf['DefaultPort'];
     if (defined("IS_ODP")) {
         $path = Bd_AppEnv::getEnv('data');
         $path = dirname(dirname($path)) . '/phpcas/';
         session_save_path($path);
     }
     phpCAS::setDebug('');
     phpCAS::client(CAS_VERSION_2_0, $link, intval($port), '');
     phpCAS::setNoCasServerValidation();
     phpCAS::handleLogoutRequests(false);
     self::$isCasClientInit = true;
     return true;
 }