コード例 #1
0
ファイル: so_user.php プロジェクト: nin-jin/hyoo.ru
 function key_make()
 {
     $cookie = so_cookie::make('so_user_key');
     $key = $cookie->value;
     if (!$key) {
         $key = so_crypt::generateKey();
         $cookie->value = $key;
     }
     return $key;
 }
コード例 #2
0
ファイル: hyoo_image.php プロジェクト: nin-jin/hyoo.ru
 function id_make()
 {
     return so_crypt::generateId();
 }
コード例 #3
0
ファイル: index.php プロジェクト: nin-jin/nin-jin.github.com
 function get_key($key)
 {
     if (isset($key)) {
         return $key;
     }
     $cookie = so_cookie::make('so_user_key');
     $key = $cookie->value;
     if (!$key) {
         $key = so_crypt::generateKey();
         $cookie->value = $key;
     }
     return $key;
 }
コード例 #4
0
ファイル: hyoo_author.php プロジェクト: nin-jin/hyoo.ru
 function post_resource($data)
 {
     $authorCurrent = hyoo_author::make();
     if ($this->key && $this !== $authorCurrent) {
         return so_output::forbidden("User [{$this->name}] is already registered");
     }
     $this->about = $data['hyoo_author_about'] ?: $this->about;
     $this->key = so_crypt::hash($this->uri, so_user::make()->key);
     $this->exists = true;
     so_cookie::make('hyoo_author_name')->value = $this->name;
     #return so_output::ok( 'Updated' );
     return so_output::created((string) $this);
 }