public function __construct() { $dsn = "mysql:host=" . $this->host . ";dbname=" . $this->dbname; $pro = new PropertyManager(); $this->host = $pro->getProperty('db_host'); $this->db_pwd = $pro->getProperty('db_pwd'); $this->db = new PDO($dsn, 'root', $this->db_pwd); }
/** * Send verify code to user's cellphone. *【注册验证】验证码.484933.,您正在注册成为探庐者用户,感谢您的支持! * @param String/int $phone 手机号 * @param String/int $verify_code 后台生成的验证码 * @return success/fail */ public function sendVerifyCode($phone, $verify_code) { $pro = new PropertyManager(); $c = new SmsServer(); $c->appkey = $pro->getProperty('sms_key'); $c->secretKey = $pro->getProperty('sms_secret'); $req = new SendSms(); $req->setExtend("1010"); $req->setSmsType("normal"); $req->setSmsFreeSignName("注册验证"); $req->setSmsParam("{\"code\":\"{$verify_code}\",\"product\":\"探庐者\"}"); $req->setRecNum($phone); $req->setSmsTemplateCode("SMS_5400651"); $resp = $c->execute($req); if ($resp->result->err_code == '0') { return true; } else { echo $resText; return false; } }
?> <input type="hidden" id="page" value="area"/> <input type="hidden" name="title" value='<?php echo $area_id; ?> '> <div class="head"> <h3>后台管理-景点介绍</h3> <div class="photo"> <h3>标题大图</h3> <span class="reminder">上传一张图(图片宽高比必须在3:1以上)</span> <!-- OSS start --> <div class="oss_photo_tool col-lg-12 clearfix" target_folder="casa" file_prefix="area" limit_size="1024" oss_address="<?php echo $pm->getProperty("oss_external"); ?> "> <div class="oss_button"> <button class="show_uploader btn btn-primary btn-sm">插入图片</button> </div> <div class="oss_hidden_input" id="preview-head"> <?php if (!empty($message->title_img)) { echo '<input type="hidden" class="hidden_photo" value="' . $message->title_img . '"/>'; } ?> </div> <div class="oss_photo"></div> </div> <!-- OSS end -->
public function __construct() { $pro = new PropertyManager(); $this->appid = $pro->getProperty('wx_appid'); $this->secret = $pro->getProperty('wx_appsecret'); }
<head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="../css/bootstrap.min.css" rel="stylesheet" media="screen" /> <link href="css/all.css" rel="stylesheet"/> <script src="../js/integration/jquery.min.js"></script> <script src="../js/integration/bootstrap.min.js"></script> <script src="../js/integration/jquery.form.js"></script> <script src="js/all.js"></script> <title>探庐者-后台管理</title> </head> <body> <?php include '../301.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/common/PropertyManager.php'; $pm = new PropertyManager(); $shutdown = $pm->getProperty("backstage_shutdown"); ?> <div id="container" style="width:400px; color: #777777"> <h1>Casarover Management</h1> <form action="../../application/controllers/login_admin_action.php" class="login_form" method="post"> <input id="redirect_url" name="redirect_url" type="hidden" value="<?php echo $_GET['redirect_url']; ?> "/> <div class="form-group login-input-m"> <input id="cellphone_number" name="cellphone_number" type="text" class="form-control" <?php if ($shutdown) { echo "disabled"; } ?>
<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/casarover/application/common/PropertyManager.php'; include_once 'oss_php_sdk_20140625/sdk.class.php'; function gmt_iso8601($time) { $expiration = date('Y-m-d\\TH:i:sO', $time); $pos = strpos($expiration, '+'); $expiration = substr($expiration, 0, $pos); return $expiration . "Z"; } $pm = new PropertyManager(); $id = $pm->getProperty("oss_id"); $key = $pm->getProperty("oss_secret"); $host = $pm->getProperty("oss_external"); $now = time(); $expire = 30; //设置该policy超时时间是10s. 即这个policy过了这个有效时间,将不能访问 $end = $now + $expire; $expiration = gmt_iso8601($end); $oss_sdk_service = new alioss($id, $key, $host); if (isset($_GET["target_folder"])) { $dir .= $_GET["target_folder"] . "/"; } else { $dir .= "test/"; } //最大文件大小.用户可以自己设置 $condition = array(0 => 'content-length-range', 1 => 0, 2 => 1024000); $conditions[] = $condition; //表示用户上传的数据,必须是以$dir开始, 不然上传会失败,这一步不是必须项,只是为了安全起见,防止用户通过policy上传到别人的目录 $start = array(0 => 'starts-with', 1 => '$key', 2 => $dir);