Пример #1
0
// 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.
require_once 'includes/functions.php';
require_once 'network-util.php';
headers_no_cache();
prepare_request();
if (($auth_error = cp_authenticate(false)) === true) {
    cp_exec($_REQUEST['r'], NETWORK_FNC_GET_STATS);
} else {
    echo 'Username and/or password invalid';
}
function _xStatsGet()
{
    require_once 'stats.php';
    network_success(load_site_stats());
}
function _xSync()
{
    $settings = unserialize(base64_decode($_REQUEST['sync']));
    // Sync blacklist
    if (isset($settings[NETWORK_SYNC_BLACKLIST]) && is_array($settings[NETWORK_SYNC_BLACKLIST])) {
        foreach ($settings[NETWORK_SYNC_BLACKLIST] as $bl_file => $file_contents) {
            file_write(DIR_BLACKLIST . '/' . $bl_file, $file_contents);
Пример #2
0
if ($_REQUEST['r'] == 'btl') {
    build_all_toplists();
    return;
}
// Recompile templates on first access
if (!isset($C['base_url'])) {
    recompile_templates();
}
headers_no_cache();
prepare_request();
if (file_exists('reset-access.php') || file_exists('../auto-install.php')) {
    echo '<div style="font-weight: bold; color: red; font-size: 14pt; text-align: center;">' . 'The auto-install.php and cp/reset-access.php files must be removed from your server before you can access the control panel' . '</div>';
    exit;
}
if (($auth_error = cp_authenticate()) === true) {
    cp_exec($_REQUEST['r'], '_xStatsOverallShow');
} else {
    include 'login.php';
}
function _xIndexShow()
{
    _xStatsOverallShow();
}
function _xUpdateShow()
{
    include 'update.php';
}
function _xSkimSchemesShow()
{
    include 'skim-schemes.php';
}
Пример #3
0
//
//    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.
define('XHR', true);
require_once 'includes/functions.php';
require_once 'validator.php';
require_once 'json.php';
headers_no_cache();
prepare_request();
if (($auth_error = cp_authenticate()) === true) {
    cp_exec($_REQUEST['r'], '_xFunctionMissing');
} else {
    JSON::Logout();
}
function _xMogrifyTest()
{
    global $C;
    $C['magick_mogrify_path'] = $_REQUEST['magick_mogrify_path'];
    check_image_resizer();
    if ($C['have_magick']) {
        JSON::Success('The mogrify path appears to be valid!');
    } else {
        if ($C['have_gd']) {
            JSON::Warning('The mogrify path does not appear to be valid, however the GD PHP extension is installed and can be used instead');
        } else {
            JSON::Warning('The mogrify path does not appear to be valid and the GD PHP extension is either not installed or configured without JPEG support.  Thumbnail resizing will not be possible.');