modules/0000775000076400007640000000000011435121111012406 5ustar sakuraisakuraimodules/simpleLogin/0000775000076400007640000000000011435351450014703 5ustar sakuraisakuraimodules/simpleLogin/screenshot.jpg0000664000076400007640000004555711435351441017602 0ustar sakuraisakuraiJFIFHHExifMM*C  !"$"$CF"N !1TU"AQRS2aq#3Bs$456rtCbc&&Q!1a2"AR ?DD#~V?(}4 n'0usBme&P䒢I{<v8szPz)^QY .0}Y!yzrIi AaHKv}1ce(a{qpޔ\EUJFZ)dK s Xs>źq\LV{McU:h9ppgrr78Sm{]uMHh&{Zaڮhガt}hWdH-{A:TP4H_v6SoGKGH$3#pp^m:]h-(])͛<Тoe[. 8L !!yi\PPީgZH`d08y)Q-ޒ5TT@ qt d`98`'>Fߥz9p]j;V6-SzpN=( Hi~]EK5S1'ssֻ踌O1SiqNUtTU ypyhOp:P_6ii[\ͮGgb7ivXǾ,9 vu] ǚx=( USWQYG)cps^2#," """ """ """ "[_YQv*ʏ[V r&eKO xjJCʨ[$c[:/Gn]UOYqM<>#KNk<}2a~ʶCtRKV';ie־Uor;|RՁrVT)ʶKVn"[_YQv*ʏ-X!Om}eG✫k*?`\->Uor;|RՁrVT)ʶKVn"[_YQv*ʏ-X!Om}eG✫k*?`\->Uor;|RՁrVT)ʶKVn"[_YQv*ʏ-X!Om}eG✫k*?`\->Uor;|RՁrVT)ʶKVn"[_YQv*ʏ-X!B 5N z9Y 8g_P|%FʃLZ$g }-w'm Cg$I#.]WZX8q_Uma  |"1\Ji=l},HKyeb} xA`-:}!G[j~FPV=0=F178 ɗcܪ55Hnnuc[8s/\6?<w3IMNUFsprY}2jJw Ԣ. FI_GQC>¦25}NRKR&1v1_4c?{>56FusU/VC$3f0H>o?ITgTGBӇHuGeuƗII4ms'[+iM41Uaı <ޟZ߹i RSГ,gNT#@vx4e9!Qѹ=gAI=uKi p$m^n LK$fyFyũEPij[8-HsA[Kߓ+mpg62 K[p<6sh*yFn6l!b_I\v; hV *kI,cZ0|u@k"<֭ilB %S!ă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ȔHY0:ܟVgɛVy(s Ϣ_8.ZݎjQy*! HǴ9`?m=⩢=HE i蟈?gsK]F HQRX& ;9?*&GʋAOwr ~#U4L6 i蟈ODGxh*,l9?)6T2>TX&r ~#WheZ=A*,l9?)6T2>TX&r ~#Sm=⩢d|LODGx z';SDQc`6NAOw3m=✃i蟈M#Eg z';9?*&GʋAOwr ~#U4L6 i蟈ODGxh*,l9?+4z5kZрuQ#Eg z';9?*&GʋAOwr ~#U4L6 i蟈ODGxh*,l9?)6T2>TX&r ~#Sm=⩢d|LODGx z';SDQc`6T)ኞF4s5`WܩQ DED@DDD@DDD@DDD@DDD@DDD@DDD@modules/simpleLogin/SimpleLoginModule.php0000664000076400007640000000121411435351441021002 0ustar sakuraisakuraisetImport(array( 'simpleLogin.models.*', 'simpleLogin.components.*', )); } public function beforeControllerAction($controller, $action) { if(parent::beforeControllerAction($controller, $action)) { // this method is called before any module controller action is performed // you may place customized code here return true; } else return false; } } modules/simpleLogin/schema.sqlite.sql0000664000076400007640000000033111435351441020161 0ustar sakuraisakuraiCREATE TABLE tbl_user ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, username VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, profile VARCHAR(128) NOT NULL ); modules/simpleLogin/controllers/0000775000076400007640000000000011435351450017251 5ustar sakuraisakuraimodules/simpleLogin/controllers/DefaultController.php0000664000076400007640000000503611435351441023416 0ustar sakuraisakuraiarray( 'class'=>'CCaptchaAction', 'backColor'=>0xEBF4FB, ), ); } /** * Displays the login page */ public function actionIndex() { $form=new MLoginForm; $previousStatus = 'login'; // collect user input data if(isset($_POST['MLoginForm'])) { $previousStatus = isset($_POST['MLoginForm']['passwordRepeat'])? 'register' : 'login'; $form->scenario='login'; $form->attributes=$_POST['MLoginForm']; if($form->validate() && !$form->errorCode) { // login OK $this->redirect(Yii::app()->user->returnUrl); } else if ($form->errorCode == MUserIdentity::USER_TO_BE_REGISTERED) { // no user found if ($previousStatus == 'login') { $this->state = self::REGISTRATION_STATE; } else { $form->scenario='register'; $form->attributes=$_POST['MLoginForm']; if($form->validate()) { $duration=$form->rememberMe ? 3600*24*30 : 0; // 30 days $user = new MUser; $user->attributes = $form->attributes; $user->password = md5($user->password); $user->save(); $identity = new MUserIdentity($form->username,$form->password); $identity->authenticate(); Yii::app()->user->login($identity, $duration); $this->redirect(Yii::app()->user->returnUrl); } else { // password error $this->state = self::REGISTRATION_STATE; } } } else { // password error if ($previousStatus == 'login') { $this->state = self::LOGIN_STATE; } else { $this->state = self::REGISTRATION_STATE; } } } // display the login form $users=MUser::model()->findAll(); $this->render('login', array('form'=>$form, 'state'=>$this->state, 'users'=>$users, )); } /** * Logout the current user and redirect to homepage. */ public function actionLogout() { Yii::app()->user->logout(); $this->redirect(Yii::app()->homeUrl); } /** * Delete the user */ public function actionDelete() { $user=MUser::model()->find('LOWER(username)=?',array(strtolower(Yii::app()->user->name))); $user->delete(); Yii::app()->user->logout(); $this->redirect(Yii::app()->homeUrl); } }modules/simpleLogin/views/0000775000076400007640000000000011435351450016040 5ustar sakuraisakuraimodules/simpleLogin/views/default/0000775000076400007640000000000011435351450017464 5ustar sakuraisakuraimodules/simpleLogin/views/default/login.php0000664000076400007640000000411411435351441021305 0ustar sakuraisakuraipageTitle=Yii::app()->name . ' - Login'; $this->breadcrumbs=array( 'SimpleLogin', ); ?>

Login

Register

You will be registered if you have not been registered yet.

10, 'cols'=>30)); ?>


clientScript->registerCss('dataGrid', ' table.dataGrid { border-collapse: collapse; } table.dataGrid th, table.dataGrid td { font-size: 9pt; border: 1px #444 solid; } table.dataGrid th { background: #81b8d6; text-align: center; } '); ?>
id ?> username ?> email ?> profile ?>
modules/simpleLogin/views/default/index.php0000664000076400007640000000043211435351441021303 0ustar sakuraisakurai

This is the view content for action "action->id; ?>". The action belongs to the controller "" in the "module->id; ?>" module.

You may customize this page by editing

modules/simpleLogin/views/layouts/0000775000076400007640000000000011435351450017540 5ustar sakuraisakuraimodules/simpleLogin/views/layouts/.yii0000664000076400007640000000000011435351441020321 0ustar sakuraisakuraimodules/simpleLogin/models/0000775000076400007640000000000011435351450016166 5ustar sakuraisakuraimodules/simpleLogin/models/MUser.php0000664000076400007640000000155011435351441017733 0ustar sakuraisakurai128), array('password','length','max'=>128), array('email','length','max'=>128), array('username, password, email, profile', 'required'), ); } }modules/simpleLogin/models/MLoginForm.php0000664000076400007640000000355411435351441020717 0ustar sakuraisakurai'login, register'), array('passwordRepeat, email, profile', 'required', 'on'=>'register'), // password needs to be authenticated array('password', 'authenticate', 'on'=>'login'), array('passwordRepeat', 'compare', 'compareAttribute'=>'password', 'on'=>'register'), array('email', 'email'), ); } /** * Declares attribute labels. */ public function attributeLabels() { return array( 'rememberMe'=>'Remember me next time', ); } /** * Authenticates the password. * This is the 'authenticate' validator as declared in rules(). */ public function authenticate($attribute,$params) { if(!$this->hasErrors()) // we only want to authenticate when no input errors { $identity=new MUserIdentity($this->username,$this->password); $identity->authenticate(); switch($this->errorCode = $identity->errorCode) { case MUserIdentity::ERROR_NONE: $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days Yii::app()->user->login($identity,$duration); break; case MUserIdentity::USER_TO_BE_REGISTERED: break; default: // UserIdentity::ERROR_PASSWORD_INVALID $this->addError('password','Password is incorrect.'); break; } } } } modules/simpleLogin/components/0000775000076400007640000000000011435351450017070 5ustar sakuraisakuraimodules/simpleLogin/components/MUserIdentity.php0000664000076400007640000000213611435351441022350 0ustar sakuraisakuraifind('LOWER(username)=?',array(strtolower($this->username))); if($user===null) { // not exist in db $this->errorCode=self::USER_TO_BE_REGISTERED; } else if(md5($this->password)!==$user->password) { // password check $this->errorCode=self::ERROR_PASSWORD_INVALID; } else { // no error $this->_id=$user->id; $this->username=$user->username; $this->errorCode=self::ERROR_NONE; } return !$this->errorCode; } /** * @return integer the ID of the user record */ public function getId() { return $this->_id; } }modules/simpleLogin/schema.mysql.sql0000664000076400007640000000033211435351441020026 0ustar sakuraisakuraiCREATE TABLE tbl_user ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, username VARCHAR(128) NOT NULL, password VARCHAR(128) NOT NULL, email VARCHAR(128) NOT NULL, profile VARCHAR(128) NOT NULL );