当前位置: 首页>>代码示例>>PHP>>正文


PHP config::accountId方法代码示例

本文整理汇总了PHP中config::accountId方法的典型用法代码示例。如果您正苦于以下问题:PHP config::accountId方法的具体用法?PHP config::accountId怎么用?PHP config::accountId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在config的用法示例。


在下文中一共展示了config::accountId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rollback

 private static function rollback()
 {
     @unlink(GsonCrypt::getkey(null));
     @unlink(GsonCrypt::getkey(null, true));
     @unlink(GsonCrypt::getcert());
     @unlink(config::$accountIdFile);
     @unlink(config::$walCfgFile);
     @(config::$accountId = null);
 }
开发者ID:perfectcode1,项目名称:Gcoin,代码行数:9,代码来源:account.php

示例2: register

 private static function register()
 {
     if (self::isRegistered()) {
         return true;
     }
     $ba = Tools::address(gio::input("Enter the bank's address"));
     if (!$ba) {
         return false;
     }
     config::$bankAddress = $ba['address'];
     config::$bankPort = intval($ba['port']);
     $net = new Gnet();
     $r = $net->send(Gmsg::create(Gmsg::prepare("", "register", config::$bankId)));
     $net = null;
     if (!$r) {
         return false;
     }
     $m = Gmsg::extract($r);
     if (!$m['status']) {
         return false;
     }
     if (gio::saverawfile($m['cert'], GsonCrypt::getcert($m['name'])) && gio::savetofile($m['cert'], GsonCrypt::getkey($m['name']))) {
         if (gio::savetofile($m['name'], config::$bankIdFile) && gio::savetofile(serialize(array(config::$bankAddress, config::$bankPort)), config::$walCfgFile)) {
             config::$bankId = $m['name'];
             config::$accountId = $m['account'];
             return true;
         } else {
             self::deregister();
             return false;
         }
     }
     return false;
 }
开发者ID:perfectcode1,项目名称:Gcoin,代码行数:33,代码来源:account.php

示例3: keygen

 public static function keygen(&$userid, $info = false)
 {
     $userid = !$userid ? config::$accountId : $userid;
     if (!$userid) {
         return false;
     }
     $dn = is_array($info) ? $info : array("countryName" => strtoupper(gio::input("Country code", "string")), "stateOrProvinceName" => strtoupper(gio::input("State code", "string")), "localityName" => gio::input("City", "string"), "organizationName" => gio::input("Your Name/Your Company Name in Full", "string"), "organizationalUnitName" => 'Digicoin', "commonName" => config::$bankId, "emailAddress" => gio::input("Contact Email Address", "string"));
     $privkeypass = config::$privateKeyPassword;
     if (!self::cryptoInstalled()) {
         gio::log("... Could not generate cryptographic keys for {$userid} ...", E_USER_ERROR);
         return false;
     }
     gio::log("Generating cryptographic keys for {$userid}...", VERBOSE);
     try {
         $privkey = @openssl_pkey_new(self::$keyOpts);
         $privateKey = "";
         $csr = @openssl_csr_new($dn, $privkey, self::$keyOpts);
         if ($csr) {
             openssl_csr_export_to_file($csr, self::getcert($userid));
             openssl_pkey_export($privkey, $privatekey, $privkeypass, self::$keyOpts);
             gio::savetofile($privatekey, self::getkey($userid, true), config::$privateKeyFileMode);
             gio::savetofile($userid, config::$accountIdFile);
             config::$accountId = $userid;
         } else {
             return false;
         }
     } catch (Exception $e) {
         gio::log("Error while generating cryptographic keys for {$userid}: " . $e->message, E_USER_ERROR);
         return false;
     }
     gio::log("... Done generating cryptographic keys for {$userid}", VERBOSE);
     return true;
 }
开发者ID:perfectcode1,项目名称:Gcoin,代码行数:33,代码来源:gcrypt.php


注:本文中的config::accountId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。