public function dogetpaypass()
 {
     false !== strpos($_POST['u'], "@") ? $data['user_email'] = text($_POST['u']) : ($data['user_name'] = text($_POST['u']));
     $vo = M('members')->field('id')->where($data)->find();
     if (is_array($vo)) {
         $res = Notice(10, $vo['id']);
         if ($res) {
             ajaxmsg();
         } else {
             ajaxmsg('', 0);
         }
     } else {
         ajaxmsg('', 0);
     }
 }
 public function emailvsend()
 {
     $data['user_email'] = text($_POST['email']);
     //判断该邮箱是否已被别人注册
     $count = M('members')->where(array("id" => array("neq", $this->uid), "user_email" => $data['user_email']))->count("1");
     if ($count > 0) {
         ajaxmsg('该邮箱已被使用', 2);
     }
     $newid = M('members')->where("id = {$this->uid}")->save($data);
     //更改邮箱,重新激活
     if ($newid) {
         $status = Notice(8, $this->uid);
         if ($status) {
             ajaxmsg('邮件已发送,请注意查收!', 1);
         } else {
             ajaxmsg('邮件发送失败,请重试!', 0);
         }
     } else {
         ajaxmsg('新邮件修改失败', 2);
     }
 }
Exemple #3
0
function MakeFont($fontfile, $enc = 'cp1252', $embed = true)
{
    // Generate a font definition file
    if (get_magic_quotes_runtime()) {
        @set_magic_quotes_runtime(0);
    }
    ini_set('auto_detect_line_endings', '1');
    if (!file_exists($fontfile)) {
        Error('Font file not found: ' . $fontfile);
    }
    $ext = strtolower(substr($fontfile, -3));
    if ($ext == 'ttf' || $ext == 'otf') {
        $type = 'TrueType';
    } elseif ($ext == 'pfb') {
        $type = 'Type1';
    } else {
        Error('Unrecognized font file extension: ' . $ext);
    }
    $map = LoadMap($enc);
    if ($type == 'TrueType') {
        $info = GetInfoFromTrueType($fontfile, $embed, $map);
    } else {
        $info = GetInfoFromType1($fontfile, $embed, $map);
    }
    $basename = substr(basename($fontfile), 0, -4);
    if ($embed) {
        if (function_exists('gzcompress')) {
            $file = $basename . '.z';
            SaveToFile($file, gzcompress($info['Data']), 'b');
            $info['File'] = $file;
            Message('Font file compressed: ' . $file);
        } else {
            $info['File'] = basename($fontfile);
            Notice('Font file could not be compressed (zlib extension not available)');
        }
    }
    MakeDefinitionFile($basename . '.php', $type, $enc, $embed, $map, $info);
    Message('Font definition file generated: ' . $basename . '.php');
}
Exemple #4
0
 public function sendverify()
 {
     $r = Notice(2, $this->uid);
     if ($r) {
         echo 1;
     } else {
         echo 0;
     }
 }
Exemple #5
0
function ShowError($str = '', $turnto = URL_ROOT, $urltitle = '返回')
{
    Notice($str, $turnto, 3, 'error', $urltitle);
}
 public function emailverify()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!is_array($arr) || empty($arr) || empty($arr['email'])) {
         ajaxmsg("数据有误!", 0);
     }
     if ($arr['uid'] != $this->uid) {
         ajaxmsg("数据有误!", 0);
     }
     $map['user_email'] = $arr['email'];
     $count = M('members')->where($map)->count('id');
     $email = M('members')->field('user_email')->find($this->uid);
     $ids = M('members_status')->getFieldByUid($this->uid, 'email_status');
     if ($count > 1) {
         ajaxmsg('此邮箱已被注册', 0);
     } elseif ($ids == 1) {
         ajaxmsg('此邮箱已认证成功', 0);
     } else {
         $data['user_email'] = $arr['email'];
         $data['last_log_time'] = time();
         $newid = M('members')->where("id = {$this->uid}")->save($data);
         //更改邮箱,重新激活
         if ($newid) {
             $status = Notice(8, $this->uid);
             if ($status) {
                 ajaxmsg('邮件已发送,请登录邮箱认证!');
             } else {
                 ajaxmsg('邮件发送失败,请检查邮箱格式,重新发送!', 0);
             }
         } else {
             ajaxmsg('新邮件修改失败', 0);
         }
     }
 }
 public function emailvsend()
 {
     session('email_temp', text($_POST['email']));
     $mid = $this->regaction();
     $status = Notice(8, $mid);
     if ($status) {
         ajaxmsg('邮件已发送,请注意查收!', 1);
     } else {
         ajaxmsg('邮件发送失败,请重试!', 0);
     }
 }
Exemple #8
0
 public function getpinpass()
 {
     $email_status = M('members_status')->where(array("uid" => $this->uid))->getField("email_status");
     if ($email_status != 1) {
         $data["jumpUrl"] = __APP__ . "/member/verify?id=1#fragment-1";
         ajaxmsg($data, 2);
         return;
     }
     $res = Notice(9, $this->uid);
     if ($res) {
         ajaxmsg();
     } else {
         ajaxmsg('', 0);
     }
 }
 public function tip()
 {
     $id = intval($_REQUEST['id']);
     $vm = M('borrow_info')->field('borrow_uid,borrow_name,borrow_money,repayment_type,deadline')->find($id);
     $borrowName = $vm['borrow_name'];
     $borrowMoney = $vm['borrow_money'];
     if ($id) {
         Notice(9, $vm['borrow_uid'], array('id' => $id, 'borrowName' => $borrowName, 'borrowMoney' => $borrowMoney));
         ajaxmsg();
     } else {
         ajaxmsg('', 0);
     }
 }
Exemple #10
0
    if (!$acl->Access("x")) {
        throw new Exception("Access denied");
    }
    echo "AJAXOK";
    if (isset($_POST['action'])) {
        switch ($_POST['action']) {
            case 'save':
                $phrase = $_POST['text'];
                $translation = $_POST['translation'];
                $lang_id = $_POST['language'];
                $db = new DB("translation");
                $db->select("translation_lang_id = '" . $lang_id . "' AND translation_phrase='" . $db->escape($phrase) . "'");
                if ($db->numRows() == 1) {
                    $c = new DB("translation");
                    $c->translation_phrase_translated = $translation;
                    $c->update("translation_lang_id = '" . $lang_id . "' AND translation_phrase='" . $db->escape($phrase) . "'");
                    echo Notice("Saved");
                } else {
                    $c = new DB("translation");
                    $c->translation_lang_id = $lang_id;
                    $c->translation_phrase = $phrase;
                    $c->translation_phrase_translated = $translation;
                    $c->insert();
                    echo Notice("insert " . $lang_id . " " . $phrase . "=>" . $translation);
                }
                break;
        }
    }
} catch (Exception $e) {
    echo _t($e->getMessage());
}
 public function dogetpass()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, ture);
     if (!is_array($arr) || empty($arr) || empty($arr['user'])) {
         ajaxmsg("数据错误!", 0);
     }
     false !== strpos($arr['user'], "@") ? $data['user_email'] = text($arr['user']) : ($data['user_name'] = text($arr['user']));
     $vo = M('members')->field('id')->where($data)->find();
     if (is_array($vo)) {
         $res = Notice(7, $vo['id']);
         if ($res) {
             ajaxmsg('发送成功');
         } else {
             ajaxmsg('发送失败', 0);
         }
     } else {
         ajaxmsg('发送失败', 0);
     }
 }
Exemple #12
0
 function synlogin($get, $post)
 {
     $uid = $get['uid'];
     $username = $get['username'];
     if (!API_SYNLOGIN) {
         return API_RETURN_FORBIDDEN;
     }
     $vo = M("members")->field("id,user_name")->where("user_name='{$username}'")->find();
     if (is_array($vo)) {
         //登陆
         foreach ($vo as $key => $v) {
             session("u_{$key}", $v);
         }
         $up['uid'] = $vo['id'];
         $up['add_time'] = time();
         $up['ip'] = get_client_ip();
         M('member_login')->add($up);
     } else {
         //注册
         require DISCUZ_ROOT . "uc_client/client.php";
         $dataUc = uc_get_user($username);
         $data['user_name'] = text($username);
         $data['user_pass'] = text($get['password']);
         $data['user_email'] = text($dataUc[2]);
         $count = M('members')->where("user_email = '{$data['user_email']}' OR user_name='{$data['user_name']}'")->count('id');
         if ($count > 0) {
             exit;
         }
         $data['reg_time'] = time();
         $data['reg_ip'] = get_client_ip();
         $data['lastlog_time'] = time();
         $data['lastlog_ip'] = get_client_ip();
         $newid = M('members')->add($data);
         if ($newid) {
             session('u_id', $newid);
             session('u_user_name', $data['user_name']);
             Notice(1, $newid);
             memberMoneyLog($newid, 1, $this->glo['award_reg'], "注册奖励");
         }
     }
     header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
     _setcookie('Example_auth', _authcode($uid . "\t" . $username, 'ENCODE'));
 }
Exemple #13
0
function query_get_zone($query, $fail_if_missing = 0)
{
    global $soa_table_name, $search_query, $query_host, $query_origin;
    if (!strlen($query)) {
        return;
    }
    if (!ends_with_dot($query)) {
        $query .= ".";
    }
    /* Search left-to-right at label boundaries for exact match */
    $labels = explode(".", $query);
    $host = array();
    do {
        if ($label = implode(".", $labels)) {
            /* Search for exact match */
            $res = sql_query("SELECT id FROM {$soa_table_name} WHERE origin='" . esc($label) . "'") or ErrSQL("Error searching for zone called " . quote($label) . ".");
            if ($res && ($row = sql_fetch_row($res))) {
                $query_origin = $label;
                $query_host = implode(".", $host);
                $search_query = $query;
                return (int) $row[0];
            }
            $host[] = array_shift($labels);
        }
    } while ($label);
    /* Search left-to-right at label boundaries for fuzzy match */
    $labels = explode(".", $query);
    $host = array();
    do {
        if ($label = implode(".", $labels)) {
            /* Search for similar match */
            $res = sql_query("SELECT id FROM {$soa_table_name} WHERE origin LIKE '%" . esc($label) . "'") or ErrSQL("Error searching for zone like " . quote($label) . ".");
            if ($res && sql_num_rows($res)) {
                zone_browser(" WHERE origin LIKE '%" . esc($label) . "'");
                exit;
            }
        }
    } while ($dummy = array_shift($labels));
    /* Try generic LIKE query */
    if (ends_with_dot($query)) {
        $query = substr($query, 0, strlen($query) - 1);
    }
    $sql_where = "WHERE origin LIKE '%" . esc($query) . "%'";
    $res = sql_query("SELECT id FROM {$soa_table_name} {$sql_where}") or ErrSQL("Error searching for zone like " . quote($query) . ".");
    if ($res && sql_num_rows($res)) {
        zone_browser($sql_where, $query);
        exit;
    }
    /* No match - fail */
    if ($fail_if_missing) {
        Notice("<B>No zones found matching your search query.</B>");
        help_screen();
    }
}
Exemple #14
0
function ShowError($str = '', $turnto = URL_ROOT, $urltitle = '返回')
{
    if ($turnto == URL_ROOT) {
        Notice($str, $turnto . '/index.php', 3, 'error', $urltitle);
    } else {
        Notice($str, $turnto, 3, 'error', $urltitle);
    }
}
Exemple #15
0
 public function sendEmaila()
 {
     $status = Notice(8, $this->uid);
 }
 public function regaction_bak()
 {
     $jsoncode = file_get_contents("php://input");
     $arr = array();
     $arr = json_decode($jsoncode, true);
     if (!is_array($arr) || empty($arr)) {
         ajaxmsg("提交信息错误,请重试.", 0);
     }
     if ($arr['name'] == "" || $arr['password'] == "" || $arr['email'] == "") {
         ajaxmsg("提交信息错误,请重试!", 0);
     }
     $data['user_name'] = text($arr['name']);
     $data['user_pass'] = md5($arr['password']);
     $data['user_email'] = text($arr['email']);
     $count = M('members')->where("user_email = '{$data['user_email']}' OR user_name='{$data['user_name']}'")->count('id');
     if ($count > 0) {
         //			$arr2 = array();
         //	        $arr2['type'] = 'regaction(';
         //			$arr2['deal_user'] = $data['user_name'];
         //	        $arr2['tstatus'] = '1';
         //			$arr2['deal_time'] = time();
         //	        $arr2['deal_info'] = $data['user_name']."注册失败,用户名或者邮件已经有人使用_".$jsoncode;
         //	        $newid = M("auser_dologs")->add($arr2);
         ajaxmsg("kk注册失败,用户名或者邮件已经有人使用", 0);
     }
     $data['reg_time'] = time();
     $data['reg_ip'] = get_client_ip();
     $data['lastlog_time'] = time();
     $data['lastlog_ip'] = get_client_ip();
     if (session("tmp_invite_user")) {
         $data['recommend_id'] = session("tmp_invite_user");
     }
     $newid = M('members')->add($data);
     if ($newid) {
         //session('u_id',$newid);
         //session('u_user_name',$data['user_name']);
         //memberMoneyLog($newid,1,$this->glo['award_reg'],"注册奖励");
         //			$arr2 = array();
         //	        $arr2['type'] = 'regaction(';
         //			$arr2['deal_user'] = $data['user_name'];
         //	        $arr2['tstatus'] = '1';
         //			$arr2['deal_time'] = time();
         //	        $arr2['deal_info'] = $data['user_name']."注册成功_".$jsoncode;
         //	        $newid = M("auser_dologs")->add($arr2);
         Notice(1, $newid, array('email', $data['user_email']));
         //$msg = array('uid'=>$newid);
         $mess = array();
         $mess['uid'] = $newid;
         $mess['username'] = $data['user_name'];
         $mess['head'] = get_avatar($newid);
         $mess['total'] = 0;
         $mess['mayuse'] = 0;
         $mess['freeze'] = 0;
         $mess['collect'] = 0;
         ajaxmsg($mess);
         //ajaxmsg();
     } else {
         ajaxmsg("注册失败,请重试", 0);
     }
 }
Exemple #17
0
</textarea></td>
                </tr>
                <tr>
                    <td class="heading" width="120px" valign="top" align="right"><b><?php 
    echo _t("Additional");
    ?>
</b></td>
                    <td valign="top" align="left">
                        <label><input type="checkbox" name="freeleech" <?php 
    echo $db->torrent_freeleech ? "CHECKED" : "";
    ?>
 /><?php 
    echo _t("Freeleech");
    ?>
</label>
                    </td>
                </tr>
                <tr>
                    <td align="right" colspan="1"><input type="submit" name="save" value="<?php 
    echo _t("Save Torrent");
    ?>
"></td>
                </tr>
            </tbody>
        </table>
    </form>

    <?php 
} catch (Exception $e) {
    echo Notice(_t($e->getMessage()));
}