コード例 #1
0
 public function reset_private_key()
 {
     // Generate a new (random) private key.
     module::set_var("fotomotorw", "fotomoto_private_key", md5(random::hash() . access::private_key()));
     message::success(t("Your Photomoto private key has been reset."));
     url::redirect("admin/fotomotorw");
 }
コード例 #2
0
ファイル: rest.php プロジェクト: andyst/gallery3
 static function get_access_token($user_id)
 {
     $key = ORM::factory("user_access_token")->where("user_id", "=", $user_id)->find();
     if (!$key->loaded()) {
         $key->user_id = $user_id;
         $key->access_key = md5(md5(uniqid(mt_rand(), true) . access::private_key()));
         $key->save();
     }
     return $key;
 }
コード例 #3
0
 static function install()
 {
     // Set up some default values.
     module::set_var("fotomotorw", "fotomoto_site_key", '');
     module::set_var("fotomotorw", "fotomoto_private_key", md5(random::hash() . access::private_key()));
     module::set_var("fotomotorw", "fotomoto_buy_prints", 1);
     module::set_var("fotomotorw", "fotomoto_buy_cards", 1);
     module::set_var("fotomotorw", "fotomoto_buy_download", 1);
     module::set_var("fotomotorw", "fotomoto_share_ecard", 1);
     module::set_var("fotomotorw", "fotomoto_share_facebook", 1);
     module::set_var("fotomotorw", "fotomoto_share_twitter", 1);
     module::set_var("fotomotorw", "fotomoto_share_digg", 1);
     module::set_version("fotomotorw", 1);
 }
コード例 #4
0
ファイル: l10n_client.php プロジェクト: shai/gallery3
 static function client_token()
 {
     return md5("l10n_client_client_token" . access::private_key());
 }
コード例 #5
0
ファイル: rest.php プロジェクト: kandsten/gallery3
 static function access_key()
 {
     $key = ORM::factory("user_access_key")->where("user_id", "=", identity::active_user()->id)->find();
     if (!$key->loaded()) {
         $key->user_id = identity::active_user()->id;
         $key->access_key = md5(random::hash() . access::private_key());
         $key->save();
     }
     return $key->access_key;
 }