Beispiel #1
0
 public function login_process_action()
 {
     if (get_setting('ucenter_enabled') == 'Y') {
         if (!($user_info = $this->model('ucenter')->login($_GET['user_name'], $_GET['password']))) {
             $user_info = $this->model('account')->check_login($_GET['user_name'], $_GET['password']);
         }
     } else {
         $user_info = $this->model('account')->check_login($_GET['user_name'], $_GET['password']);
     }
     if ($user_info) {
         if ($user_info['forbidden'] == 1) {
             echo jsonp_encode(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('抱歉, 你的账号已经被禁止登录')));
         }
         if ($_POST['net_auto_login']) {
             $expire = 60 * 60 * 24 * 360;
         }
         $this->model('account')->update_user_last_login($user_info['uid']);
         $this->model('account')->setcookie_logout();
         $this->model('account')->setcookie_login($user_info['uid'], $_GET['user_name'], $_GET['password'], $user_info['salt'], $expire);
         echo jsonp_encode(AWS_APP::RSM(null, 1, null));
     } else {
         echo jsonp_encode(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请输入正确的帐号或密码')));
     }
 }
Beispiel #2
0
    $url = implode("&", $exclude_signiture);
    return $url;
}
// preparing $key for cache
$key = parse_url_for_key();
//$cache = new FileCache();
$interface_type = isset($_GET['interface']) ? sanitize($_GET['interface']) : "";
if ($interface_type == "") {
    //echo "This is the access to UTM API. Click <a href='./index.html'>here</a> to learn to use it.";
    echo "unknown";
    exit;
}
$jsonResult = array();
$sentItRaw = false;
if (@$interface[$interface_type] === true) {
    include dirname(__FILE__) . "/interface/" . $interface_type . ".php";
} else {
    if (@$interface[$interface_type] === false) {
        array_push($jsonResult, array('error' => 'API closed for maintenance'));
    } else {
        array_push($jsonResult, array('error' => 'API not exists!'));
    }
}
if ($interface_type == "podcast") {
    header("HTTP/1.1 401 KO");
} else {
    header("HTTP/1.1 200 OK");
}
header('Content-Type: application/json');
$json = jsonp_encode($jsonResult);
echo $json;