예제 #1
0
 public function testPassword()
 {
     $pass = '******';
     $hash = Clips\password($pass);
     $this->assertTrue(Clips\password($pass, $hash));
     // For md5
     $hash = Clips\password($pass, null, true);
     $this->assertTrue(Clips\password($pass, $hash, true));
 }
 public function fake_user()
 {
     $now = new \DateTime();
     for ($i = 0; $i < 10; $i++) {
         $uid = $this->user->insert(array('create_date' => $now->format('Y-m-d H:i:s')));
         if ($i == 0) {
             $this->groupuser->insert(array('uid' => $uid, 'gid' => $this->merchant_group_id));
             $mid = $this->merchant->insert(array('id' => $this->merchant_id, 'uid' => $uid, 'name' => 'Pinet Group Coupon', 'is_main_store' => '1', 'create_date' => $now->format('Y-m-d H:i:s')));
             $this->fake_product($mid);
         } else {
             $this->uids[] = $uid;
             $this->groupuser->insert(array('uid' => $uid, 'gid' => $this->user_group_id));
             $this->fake_user_coupon($uid);
         }
         $name = $this->fakedata->fakeName();
         if ($i == 0) {
             $name->simple_name = 'pinet_suzhou';
         }
         $this->userinfo->insert(array('uid' => $uid, 'username' => $name->simple_name, 'password' => \Clips\password('password'), 'first_name' => $name->first_name, 'last_name' => $name->last_name, 'email_address' => $this->fakedata->fakeEmail($name->simple_name), 'create_date' => $now->format('Y-m-d H:i:s')));
     }
 }
 /**
  * @Clips\Form("admin/user_modify_merchant")
  * @Clips\Model({"userInfo","user","merchant"})
  * @Clips\Form('admin/user_add_merchant')
  * @Clips\Scss("admin/home")
  * @Clips\Widget({"grid", "image", "bootstrap", "owlcarousel",  "yizhifu"})
  */
 public function modify_merchant_form()
 {
     $this->userinfo->updateInfo($this->request->post(), \Clips\password($this->request->post('password')));
     return $this->redirect(\Clips\site_url('admin/user/merchant'));
 }