Example #1
0
 *
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
global $IFACE;
if ($IFACE != "SPAWNING NEW IFACE" || $_GET['IFACE'] != '') {
    print 'HACKERS?';
    die;
}
if ($_WT_hook_included_ != '##WT_Hook_Included##') {
    $_WT_hook_included_ = '##WT_Hook_Included##';
    function WT_on_user_delete($user_id)
    {
        /* util.php is not included set, so we need this stupid code here */
        global $XPFS;
        $q = db_select('tester_solutions', array('id'), "`user_id`={$user_id}");
        while ($r = db_row($q)) {
            $XPFS->removeItem('/tester/testing/' . $r['id']);
        }
        db_delete('tester_solutions', "`user_id`={$user_id}");
    }
    function WT_on_group_delete($group_id)
    {
        db_delete('tester_contestgroup', "`group_id`={$group_id}");
        db_delete('tester_contestjudge', "`group_id`={$group_id}");
    }
    hook_register('CORE.Security.OnUserDelete', WT_on_user_delete);
    hook_register('CORE.Security.OnGroupDelete', WT_on_group_delete);
}
Example #2
0
    function file_unlink_encrypted($id)
    {
        if ($id == '') {
            return;
        }
        $d = db_row_value('files', "`id`={$id}");
        if ($d['id'] != '') {
            db_delete('files', "`id`={$id}");
            @unlink(config_get('storage-enc') . '/' . $d['name']);
        }
    }
    function file_block_encrypted($id, $blocked)
    {
        if ($blocked) {
            db_update('files', array('blocked' => 1), "`id`={$id}");
        } else {
            db_update('files', array('blocked' => 0), "`id`={$id}");
        }
    }
    function file_allow_encrypted($id, $val = true)
    {
        global $file_encrypted_allowed;
        $file_encrypted_allowed[$id] = $val;
    }
    function file_encrypted_on_user_logout()
    {
        global $file_encrypted_allowed;
        $file_encrypted_allowed = array();
    }
    hook_register('CORE.Security.OnUserLogout', file_encrypted_on_user_logout);
}
Example #3
0
define("MOD_{$___TEMP_namespace_name}", 1);
define("IMPORT_MODULE_{$___TEMP_namespace_name}_GLOBALS", $___TEMP_c);
if (!defined('IMPORT_WITH')) {
    define("IMPORT_WITH", '$___TEMP_PREFIX=\'');
}
define("PREFIX_MODULE_{$___TEMP_namespace_name}_GLOBALS", $___TEMP_d);
if (!defined('IMPORT_TO')) {
    define("IMPORT_TO", '$___TEMP_VARNAME=\'');
}
define("MODULE_{$___TEMP_namespace_name}_GLOBALS", $___TEMP_e);
$___TEMP_a = get_defined_functions()['user'];
$___TEMP_b = array();
foreach ($___TEMP_a as $___TEMP_key) {
    if (strtoupper(substr($___TEMP_key, 0, strlen($___TEMP_namespace_name) + 1)) == strtoupper($___TEMP_namespace_name . '\\')) {
        array_push($___TEMP_b, substr($___TEMP_key, strlen($___TEMP_namespace_name) + 1));
    }
}
foreach ($___TEMP_b as $___TEMP_key) {
    if ($___TEMP_key != 'init' && $___TEMP_key != '___pre_init' && $___TEMP_key != '___post_init') {
        hook_register(__NAMESPACE__, $___TEMP_key);
    }
}
unset($___TEMP_namespace_name);
unset($___TEMP_cc);
unset($___TEMP_a);
unset($___TEMP_b);
unset($___TEMP_c);
unset($___TEMP_d);
unset($___TEMP_e);
unset($___TEMP_f);
unset($___TEMP_key);