Example #1
0
/**
* For ban ips .. 
*/
function get_ban()
{
    global $banss, $lang, $tpl, $text;
    //visitor ip now
    $ip = get_ip();
    //now .. loop for banned ips
    if (is_array($banss) && !empty($ip)) {
        foreach ($banss as $ip2) {
            $ip2 = trim($ip2);
            if (empty($ip2)) {
                continue;
            }
            //first .. replace all * with something good .
            $replace_it = str_replace("*", '([0-9]{1,3})', $ip2);
            $replace_it = str_replace(".", '\\.', $replace_it);
            if ($ip == $ip2 || @preg_match('/' . preg_quote($replace_it, '/') . '/i', $ip)) {
                ($hook = kleeja_run_hook('banned_get_ban_func')) ? eval($hook) : null;
                //run hook
                kleeja_info($lang['U_R_BANNED'], $lang['U_R_BANNED']);
            }
        }
    }
    ($hook = kleeja_run_hook('get_ban_func')) ? eval($hook) : null;
    //run hook
}
Example #2
0
 */
define('IN_SUBMIT_UPLOADING', isset($_POST['submitr']) || isset($_POST['submittxt']));
/**
 * @ignore
 */
define('IN_KLEEJA', true);
define('PATH', dirname(__FILE__) . DIRECTORY_SEPARATOR);
include PATH . 'includes/common.php';
include PATH . 'includes/classes/uploading.php';
$kljup = new uploading();
$kljup->allowed_extensions = $d_groups[$user->data['group_id']]['exts'];
($hook = $plugin->run_hook('begin_index_page')) ? eval($hook) : null;
//run hook
#Is kleeja only for memebers ?!
if (empty($d_groups[2]['exts']) && !$user->is_user()) {
    kleeja_info($lang['SITE_FOR_MEMBER_ONLY'], $lang['HOME']);
}
if (ip('submit_files')) {
    $kljup->process();
    #show errors and info
    $ERRORS = sizeof($kljup->errors) ? $kljup->errors : false;
    #results
    $RESULTS = $kljup->results;
    #after sumbit template
    $current_template = 'uploading_results.php';
} else {
    #default template
    $current_template = 'index_body.php';
}
#how many inputs should be shown
$FILES_NUM_LOOP = array();
					</script>';
                kleeja_info($lang['ARE_YOU_SURE_DO_THIS'], '', true, false, 0, $extra_codes);
            }
        }
        #else
        break;
        //
        //Page of last stats
        //
    //
    //Page of last stats
    //
    case 'stats':
        //stop .. check first ..
        if (!$config['allow_stat_pg']) {
            kleeja_info($lang['STATS_CLOSED'], $lang['STATS_CLOSED']);
        }
        //stats of most online users
        if (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '') {
            $most_online = 1;
            // 1 == you
            $on_muoe = time();
        } else {
            list($most_online, $on_muoe) = @explode(':', $config['most_user_online_ever']);
        }
        //ok .. go on
        $titlee = $lang['STATS'];
        $stylee = 'stats';
        $files_st = $stat_files;
        $users_st = $stat_users;
        $sizes_st = Customfile_size($stat_sizes);
Example #4
0
File: ucp.php Project: omtim/kleeja
             $to = $row['mail'];
             $subject = $lang['GET_LOSTPASS'] . ':' . $config['sitename'];
             $activation_link = $config['siteurl'] . 'ucp.php?go=get_pass&activation_key=' . urlencode($hash_key) . '&uid=' . $row['id'];
             $message = "\n " . $lang['WELCOME'] . " " . $row['name'] . "\r\n " . sprintf($lang['GET_LOSTPASS_MSG'], $activation_link, $newpass) . "\r\n\r\n kleeja.com";
             $update_query = array('UPDATE' => "{$dbprefix}users", 'SET' => "new_password = '******', hash_key = '" . $hash_key . "'", 'WHERE' => 'id=' . $row['id']);
             ($hook = $plugin->run_hook('qr_update_newpass_get_pass')) ? eval($hook) : null;
             //run hook
             $SQL->build($update_query);
             $SQL->free($result);
             #send it to the user with an activation link
             $send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
             if (!$send) {
                 kleeja_error($lang['CANT_SEND_NEWPASS']);
             } else {
                 $text = $lang['OK_SEND_NEWPASS'] . '<br /><a href="' . $config['siteurl'] . ($config['mod_writer'] ? 'login.html' : 'ucp.php?go=login') . '">' . $lang['LOGIN'] . '</a>';
                 kleeja_info($text);
             }
         }
     }
     ($hook = $plugin->run_hook('end_get_pass')) ? eval($hook) : null;
     //run hook
     break;
     //
     // add your own code here
     //
 //
 // add your own code here
 //
 default:
     ($hook = $plugin->run_hook('default_usrcp_page')) ? eval($hook) : null;
     //run hook
Example #5
0
if ($config['siteclose'] == '1' && !user_can('enter_acp') && !defined('IN_LOGIN') && !defined('IN_ADMIN')) {
    //if download, images ?
    if (defined('IN_DOWNLOAD') && (isset($_GET['img']) || isset($_GET['thmb']) || isset($_GET['thmbf']) || isset($_GET['imgf']))) {
        @$SQL->close();
        $fullname = "images/site_closed.jpg";
        $filesize = filesize($fullname);
        header("Content-length: {$filesize}");
        header("Content-type: image/jpg");
        readfile($fullname);
        exit;
    }
    // Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    kleeja_info($config['closemsg'], $lang['SITE_CLOSED']);
}
//exceed total size
if ($stat_sizes >= $config['total_size'] * 1048576 && !defined('IN_LOGIN') && !defined('IN_ADMIN')) {
    // Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
    header('HTTP/1.1 503 Service Temporarily Unavailable');
    kleeja_info($lang['SIZES_EXCCEDED'], $lang['STOP_FOR_SIZE']);
}
kleeja_detecting_bots();
//check for page numbr
if (empty($perpage) || intval($perpage) == 0) {
    $perpage = 14;
}
//captch file
$captcha_file_path = $config['siteurl'] . 'ucp.php?go=captcha';
($hook = kleeja_run_hook('end_common')) ? eval($hook) : null;
//run hook
#<-- EOF
Example #6
0
File: go.php Project: Saleh7/Kleeja
         case 'sync_images':
             #no start ? or there
             $start = !isset($_GET['start']) ? false : intval($_GET['start']);
             $end = sync_total_files(false, $start);
             #no end, then sync'ing is done...
             if (!$end) {
                 delete_cache('data_stats');
                 $text = $title = sprintf($lang['SYNCING_DONE'], $lang['ALL_IMAGES']) . ' (' . (!$start ? 0 : $start) . '->' . (!$end ? '?' : $end) . ')';
                 $link_to_go = './admin/?cp=r_repair#!cp=r_repair';
             } else {
                 $text = $title = sprintf($lang['SYNCING'], $lang['ALL_IMAGES']);
                 $link_to_go = './go.php?go=resync&case=sync_images&start=' . $end;
             }
             //to be sure !
             $text .= '<script type="text/javascript"> setTimeout("location.href=\'' . $link_to_go . '\';", 3000);</script>' . "\n";
             kleeja_info($text, $title, true, $link_to_go, 2);
             break;
     }
     break;
     //
     // Default , if you are a developer , you can embed your page here with this hook
     // by useing $_GET[go] and your codes.
     //
 //
 // Default , if you are a developer , you can embed your page here with this hook
 // by useing $_GET[go] and your codes.
 //
 default:
     $no_request = true;
     ($hook = kleeja_run_hook('default_go_page')) ? eval($hook) : null;
     //run hook