class WebUser extends CWebUser{ public $lastname; public $email; public $userid; public $phone; public function login($identity, $duration=0) { parent::login($identity, $duration); $user = $identity->getUser(); $this->id = $user["email"]; $this->name = $user["name"]; $this->setState("info", $user); $this->saveToCookie($duration); } protected function loadIdentityStates($states) { parent::loadIdentityStates($states); $this->loadVariables(); } public function loadVariables() { $info = $this->getState("info"); if ($info === null) { $this->userid = null; $this->lastname = null; $this->email = null; $this->phone = null; } $this->userid = $info["id"]; $this->name = $info["name"]; $this->lastname = $info["lastname"]; $this->email = $info["email"]; $this->phone = $info["phone"]; } public function get() { $this->loadVariables(); return $this; } public static function getCurrentUser() { return Yii::app()->user->get(); } public function getIsGuest() { if ($this->getState('info')===null) { return true; } /* $info = $this->getState("info"); if (!is_array($info) || !isset($info["id"]) || !isset($info["id"]) || !isset($info["name"]) || !isset($info["lastname"]) || !isset($info["email"]) || !isset($info["phone"])) { return true; } */ return false; } public function getOriginalDuration() { $request=Yii::app()->getRequest(); $cookies=$request->getCookies(); $cookie=$cookies->itemAt($this->getStateKeyPrefix()); if($cookie && !empty($cookie->value) && ($data=Yii::app()->getSecurityManager()->validateData($cookie->value))!==false) { $data=@unserialize($data); if(is_array($data) && isset($data[0],$data[1],$data[2],$data[3])) { // data is an array containing id, name, duration, states // so second index is the duration return $data[2]; } } return 0; } public function updateField($field, $value) { $info = $this->getState("info"); if (!isset($info[$field])) { return; } $info[$field] = $value; $this->setState("info", $info); $info = $this->getState("info", $info); if ($info[$field] !== $value) { throw new CException("not saved0"); } $this->loadVariables(); $duration = $this->getOriginalDuration(); $this->saveToCookie($duration); $this->renewCookie(); } } ?> class WebUser extends CWebUser{ public $lastname; public $email; public $userid; public $phone; public function login($identity, $duration=0) { parent::login($identity, $duration); $user = $identity->getUser(); $this->id = $user["email"]; $this->name = $user["name"]; $this->setState("info", $user); $this->saveToCookie($duration); } protected function loadIdentityStates($states) { parent::loadIdentityStates($states); $this->loadVariables(); } public function loadVariables() { $info = $this->getState("info"); if ($info === null) { $this->userid = null; $this->lastname = null; $this->email = null; $this->phone = null; } $this->userid = $info["id"]; $this->name = $info["name"]; $this->lastname = $info["lastname"]; $this->email = $info["email"]; $this->phone = $info["phone"]; } public function get() { $this->loadVariables(); return $this; } public static function getCurrentUser() { return Yii::app()->user->get(); } public function getIsGuest() { if ($this->getState('info')===null) { return true; } /* $info = $this->getState("info"); if (!is_array($info) || !isset($info["id"]) || !isset($info["id"]) || !isset($info["name"]) || !isset($info["lastname"]) || !isset($info["email"]) || !isset($info["phone"])) { return true; } */ return false; } public function getOriginalDuration() { $request=Yii::app()->getRequest(); $cookies=$request->getCookies(); $cookie=$cookies->itemAt($this->getStateKeyPrefix()); if($cookie && !empty($cookie->value) && ($data=Yii::app()->getSecurityManager()->validateData($cookie->value))!==false) { $data=@unserialize($data); if(is_array($data) && isset($data[0],$data[1],$data[2],$data[3])) { // data is an array containing id, name, duration, states // so second index is the duration return $data[2]; } } return 0; } public function updateField($field, $value) { $info = $this->getState("info"); if (!isset($info[$field])) { return; } $info[$field] = $value; $this->setState("info", $info); $info = $this->getState("info", $info); if ($info[$field] !== $value) { throw new CException("not saved0"); } $this->loadVariables(); $duration = $this->getOriginalDuration(); $this->saveToCookie($duration); $this->renewCookie(); } } ?>
/home/xgmexgme/public_html/yii/framework/YiiBase.php(217)
205 elseif($n===4) 206 $object=new $type($args[1],$args[2],$args[3]); 207 else 208 { 209 unset($args[0]); 210 $class=new ReflectionClass($type); 211 // Note: ReflectionClass::newInstanceArgs() is available for PHP 5.1.3+ 212 // $object=$class->newInstanceArgs($args); 213 $object=call_user_func_array(array($class,'newInstance'),$args); 214 } 215 } 216 else 217 $object=new $type; 218 219 foreach($config as $key=>$value) 220 $object->$key=$value; 221 222 return $object; 223 } 224 225 /** 226 * Imports a class or a directory. 227 * 228 * Importing a class is like including the corresponding class file. 229 * The main difference is that importing a class is much lighter because it only
| #0 |
+
–
/home/xgmexgme/public_html/yii/framework/base/CModule.php(386): YiiBase::createComponent() 381 $config=$this->_componentConfig[$id]; 382 if(!isset($config['enabled']) || $config['enabled']) 383 { 384 Yii::trace("Loading \"$id\" application component",'system.CModule'); 385 unset($config['enabled']); 386 $component=Yii::createComponent($config); 387 $component->init(); 388 return $this->_components[$id]=$component; 389 } 390 } 391 } |
| #1 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CWebApplication.php(209): CModule->getComponent() 204 /** 205 * @return CWebUser the user session information 206 */ 207 public function getUser() 208 { 209 return $this->getComponent('user'); 210 } 211 212 /** 213 * Returns the view renderer. 214 * If this component is registered and enabled, the default |
| #2 |
+
–
/home/xgmexgme/public_html/yii/framework/web/auth/CAccessControlFilter.php(132): CWebApplication->getUser() 127 */ 128 protected function preFilter($filterChain) 129 { 130 $app=Yii::app(); 131 $request=$app->getRequest(); 132 $user=$app->getUser(); 133 $verb=$request->getRequestType(); 134 $ip=$request->getUserHostAddress(); 135 136 foreach($this->getRules() as $rule) 137 { |
| #3 |
+
–
/home/xgmexgme/public_html/yii/framework/web/filters/CFilter.php(38): CAccessControlFilter->preFilter() 33 * if the action should be executed. 34 * @param CFilterChain $filterChain the filter chain that the filter is on. 35 */ 36 public function filter($filterChain) 37 { 38 if($this->preFilter($filterChain)) 39 { 40 $filterChain->run(); 41 $this->postFilter($filterChain); 42 } 43 } |
| #4 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CController.php(1145): CFilter->filter() 1140 */ 1141 public function filterAccessControl($filterChain) 1142 { 1143 $filter=new CAccessControlFilter; 1144 $filter->setRules($this->accessRules()); 1145 $filter->filter($filterChain); 1146 } 1147 1148 /** 1149 * Returns a persistent page state value. 1150 * A page state is a variable that is persistent across POST requests of the same page. |
| #5 |
+
–
/home/xgmexgme/public_html/yii/framework/web/filters/CInlineFilter.php(58): CController->filterAccessControl() 53 * @param CFilterChain $filterChain the filter chain that the filter is on. 54 */ 55 public function filter($filterChain) 56 { 57 $method='filter'.$this->name; 58 $filterChain->controller->$method($filterChain); 59 } 60 } |
| #6 |
+
–
/home/xgmexgme/public_html/yii/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter() 125 { 126 if($this->offsetExists($this->filterIndex)) 127 { 128 $filter=$this->itemAt($this->filterIndex++); 129 Yii::trace('Running filter '.($filter instanceof CInlineFilter ? get_class($this->controller).'.filter'.$filter->name.'()':get_class($filter).'.filter()'),'system.web.filters.CFilterChain'); 130 $filter->filter($this); 131 } 132 else 133 $this->controller->runAction($this->action); 134 } 135 } |
| #7 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CController.php(291): CFilterChain->run() 286 $this->runAction($action); 287 else 288 { 289 $priorAction=$this->_action; 290 $this->_action=$action; 291 CFilterChain::create($this,$action,$filters)->run(); 292 $this->_action=$priorAction; 293 } 294 } 295 296 /** |
| #8 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CController.php(265): CController->runActionWithFilters() 260 { 261 if(($parent=$this->getModule())===null) 262 $parent=Yii::app(); 263 if($parent->beforeControllerAction($this,$action)) 264 { 265 $this->runActionWithFilters($action,$this->filters()); 266 $parent->afterControllerAction($this,$action); 267 } 268 } 269 else 270 $this->missingAction($actionID); |
| #9 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CWebApplication.php(282): CController->run() 277 { 278 list($controller,$actionID)=$ca; 279 $oldController=$this->_controller; 280 $this->_controller=$controller; 281 $controller->init(); 282 $controller->run($actionID); 283 $this->_controller=$oldController; 284 } 285 else 286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', 287 array('{route}'=>$route===''?$this->defaultController:$route))); |
| #10 |
+
–
/home/xgmexgme/public_html/yii/framework/web/CWebApplication.php(141): CWebApplication->runController() 136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 137 $_GET[$name]=$value; 138 } 139 else 140 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 141 $this->runController($route); 142 } 143 144 /** 145 * Registers the core application components. 146 * This method overrides the parent implementation by registering additional core components. |
| #11 |
+
–
/home/xgmexgme/public_html/yii/framework/base/CApplication.php(180): CWebApplication->processRequest() 175 public function run() 176 { 177 if($this->hasEventHandler('onBeginRequest')) 178 $this->onBeginRequest(new CEvent($this)); 179 register_shutdown_function(array($this,'end'),0,false); 180 $this->processRequest(); 181 if($this->hasEventHandler('onEndRequest')) 182 $this->onEndRequest(new CEvent($this)); 183 } 184 185 /** |
| #12 |
+
–
/home/xgmexgme/public_html/basitpazar/index.php(13): CApplication->run() 08 defined('YII_DEBUG') or define('YII_DEBUG',true); 09 // specify how many levels of call stack should be shown in each log message 10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); 11 12 require_once($yii); 13 Yii::createWebApplication($config)->run(); |