Beispiel #1
0
 function __construct($name, User $user)
 {
     //  populate the data property with all fieds from the database table
     sanity_check($name, $user);
     $this->name = $name;
     $this->user = $user;
     $this->data = $this->hydrate($name);
 }
Beispiel #2
0
"/>
</fieldset>


<p><input type="submit" value="Test configuration"></p>

</form>

<?php 
if ($op == 'testconfig') {
    ?>

	<h2>Checking configuration</h2>

	<?php 
    $errors = sanity_check($DB_TYPE);
    if (count($errors) > 0) {
        print "<p>Some configuration tests failed. Please correct them before continuing.</p>";
        print "<ul>";
        foreach ($errors as $error) {
            print "<li style='color : red'>{$error}</li>";
        }
        print "</ul>";
        exit;
    }
    $notices = array();
    if (!function_exists("curl_init")) {
        array_push($notices, "It is highly recommended to enable support for CURL in PHP.");
    }
    if (function_exists("curl_init") && ini_get("open_basedir")) {
        array_push($notices, "CURL and open_basedir combination breaks support for HTTP redirects. See the FAQ for more information.");
Beispiel #3
0
 function sanityCheck()
 {
     $_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true";
     $reply = array();
     $reply['error'] = sanity_check($this->link);
     if ($reply['error']['code'] == 0) {
         $reply['init-params'] = make_init_params($this->link);
         $reply['runtime-info'] = make_runtime_info($this->link);
     }
     print json_encode($reply);
 }
Beispiel #4
0
<?php

//  Copyright 2008 Mahesh Asolkar
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//
// Include library of functions
//
include 'lib/config.inc';
include 'lib/onlyblog.php';
check_config_inc();
include 'config.inc';
include $__config['theme_dir'] . "/theme.php";
blog_init();
if (sanity_check() == 1) {
    show_page();
} else {
    show_setup_help_page();
}
Beispiel #5
0
require_once "prefs.php";
require_once "users.php";
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$dt_add = get_script_dt_add();
no_cache_incantation();
header('Content-Type: text/html; charset=utf-8');
$op = $_REQUEST["op"];
if (!$_SESSION["uid"] && $op != "fetch-profiles") {
    print json_encode(array("error" => 6));
    return;
} else {
    if ($_SESSION["uid"]) {
        update_heartbeat($link);
    }
}
if (!sanity_check($link)) {
    return;
}
switch ($op) {
    case "create-user":
        $login = strtolower(db_escape_string($_REQUEST["login"]));
        $rv = array();
        if ($_SESSION["access_level"] >= 10) {
            $result = db_query($link, "SELECT id FROM ttirc_users WHERE\n\t\t\t\tlogin = '******'");
            if (db_num_rows($result) == 0) {
                $tmp_password = make_password();
                $pwd_hash = db_escape_string(encrypt_password($tmp_password, $login));
                $rv[0] = T_sprintf("Created user %s with password <b>%s</b>.", $login, $tmp_password);
                db_query($link, "INSERT INTO ttirc_users \n\t\t\t\t\t(login, pwd_hash, email, nick, realname) \n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$login}', '{$pwd_hash}', '{$login}@localhost', '{$login}', '{$login}')");
            } else {
                $rv[0] = T_sprintf("User %s already exists", $login);
Beispiel #6
0
 function sanityCheck()
 {
     $_SESSION["hasAudio"] = $_REQUEST["hasAudio"] === "true";
     $_SESSION["hasSandbox"] = $_REQUEST["hasSandbox"] === "true";
     $_SESSION["hasMp3"] = $_REQUEST["hasMp3"] === "true";
     $_SESSION["clientTzOffset"] = $_REQUEST["clientTzOffset"];
     $reply = array();
     $reply['error'] = sanity_check();
     if ($reply['error']['code'] == 0) {
         $reply['init-params'] = make_init_params();
         $reply['runtime-info'] = make_runtime_info();
     }
     print json_encode($reply);
 }
Beispiel #7
0
$update_methods = array(0 => __("Default"), 1 => __("Magpie"), 2 => __("SimplePie"), 3 => __("Twitter OAuth"));
if (DEFAULT_UPDATE_METHOD == "1") {
    $update_methods[0] .= ' (SimplePie)';
} else {
    $update_methods[0] .= ' (Magpie)';
}
$access_level_names = array(0 => __("User"), 5 => __("Power User"), 10 => __("Administrator"));
require_once "modules/pref-prefs.php";
require_once "modules/popup-dialog.php";
require_once "modules/help.php";
require_once "modules/pref-feeds.php";
require_once "modules/pref-filters.php";
require_once "modules/pref-labels.php";
require_once "modules/pref-users.php";
require_once "modules/pref-instances.php";
$error = sanity_check($link);
if ($error['code'] != 0 && $op != "logout") {
    print json_encode(array("error" => $error));
    return;
}
switch ($op) {
    // Select action according to $op value.
    case "rpc":
        // Handle remote procedure calls.
        handle_rpc_request($link);
        break;
        // rpc
    // rpc
    case "feeds":
        $subop = $_REQUEST["subop"];
        $root = (bool) $_REQUEST["root"];