PATH:
home
/
letacommog
/
letaweb
/
protected
/
modules
/
admin
/
controllers
<?php class ProfileController extends PController { public $layout = 'admin_column'; public function filters() { return array( 'accessControl', ); } public function accessRules() { $module = $this->getModule(); return array( array('allow', 'actions' => array( 'ajaxupdate','index','create','manage','delete','update','resetpassword', ), 'roles' => array($module->userManagerRole), ), array('allow', // deny all users 'actions' => array( 'logout','login', ), 'users' => array('@'), ), array('deny', // deny all users 'users' => array('*'), ), ); } public function actionView() { $id = Yii::app()->user->getId(); $model = User::model()->findByPk((int) $id); $socials = Social::model()->findAll('yiiuser=:user', array(':user' => $id)); $this->render('view', array('model' => $model, 'socials' => $socials)); } public function actionIndex() { $model = new UserForm('update'); if (isset($_POST['UserForm'])) { $model->attributes = $_POST['UserForm']; $model->password = 'password'; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } $id = $id = Yii::app()->user->getId(); $user = User::model()->findByPk((int) $id); if ($user == null) { $url = $this->createUrl('index'); $this->redirect($url); } $attributes = array(); foreach ($model->getAttributes() as $name => $value) { $model->$name = $user->$name; } $socials = Social::model()->findAll('yiiuser=:user', array(':user' => $id)); $this->render('update', array('model' => $model, 'socials' => $socials)); } public function actionAjaxUpdate() { $act = $_GET['act']; $autoIdAll = $_POST['autoId']; if (count($autoIdAll) > 0) { foreach ($autoIdAll as $autoId) { $model = User::model()->findByPk($autoId); if ($act == 'doDelete') { $model->is_deleted = '1'; } if ($act == 'doActive') { $model->is_active = '1'; } if ($act == 'doInactive') { $model->is_active = '0'; } if ($model->save()) { echo 'ok'; } else { throw new Exception('Sorry', 500); } } } } public function actionResetpassword() { $model = new ResetPassForm(); if (isset($_POST['ResetPassForm'])) { $model->attributes = $_POST['ResetPassForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } if (!isset($_REQUEST['id'])) { $url = $this->createUrl('index'); $this->redirect($url); } $id = $_REQUEST['id']; $user = User::model()->findByPk((int) $id); if (is_null($user) || !isset($user)) { $url = $this->createUrl('index'); $this->redirect($url); } $model->id = $id; $this->render('reset', array('model' => $model)); } public function actionCreate() { $model = new UserForm('create'); if (isset($_POST['UserForm'])) { $model->attributes = $_POST['UserForm']; if ($model->save()) { $url = $this->createUrl('index'); $this->redirect($url); } } $this->render('create', array('model' => $model)); } public function actionLogout() { Yii::app()->user->logout(); $url = $this->createUrl('/site/login'); $this->redirect($url); } public function actionLogin() { $this->render('login'); } }
[+]
..
[-] TemplateController.php
[edit]
[-] PlanController.php
[edit]
[-] DomainController.php
[edit]
[-] WebsiteController.php
[edit]
[-] ConfigController.php
[edit]
[-] TransactionController.php
[edit]
[-] MailtemplateController.php
[edit]
[-] DefaultController.php
[edit]
[-] CategoryController.php
[edit]
[-] DashboardController.php
[edit]
[-] UserController.php
[edit]
[-] LanguageController.php
[edit]
[-] ModuleController.php
[edit]
[-] ModulecategoryController.php
[edit]
[-] PlanDescriptionController.php
[edit]
[-] TermController.php
[edit]
[-] SubscriptionController.php
[edit]
[-] InterfaceController.php
[edit]
[-] ColorController.php
[edit]
[-] ShareButtonController.php
[edit]
[-] SkinpresetController.php
[edit]
[-] ContentController.php
[edit]
[-] LogController.php
[edit]
[-] ProfileController.php
[edit]