Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inputs skin fix #62

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
427ed5c
Logboost PHP API added
logboost Jan 27, 2016
9a2f083
data files removed form git
logboost Jan 27, 2016
7fe4989
gitignore data folder
logboost Jan 27, 2016
7c43205
Free access implemented
logboost Jan 27, 2016
8452f45
bug fix
logboost Jan 27, 2016
f1fc099
Logboost connection implemented
logboost Jan 27, 2016
9ccc544
Logboost settings implemented
logboost Jan 28, 2016
34a80a7
login button design improved
logboost Jan 29, 2016
25990b4
Admin login separated from visitor login
logboost Jan 29, 2016
0764217
Login screen marketing improved
logboost Jan 29, 2016
9a3aeb5
Warning message added when logboost account not activated
logboost Jan 29, 2016
b1146d4
design improvements
logboost Jan 31, 2016
e11fcb0
Free & Premium hoster count enabled
logboost Jan 31, 2016
ca32e73
Total added to index page
logboost Jan 31, 2016
9ce0f35
minor changes
logboost Jan 31, 2016
baf6c02
default config modified
logboost Jan 31, 2016
8e70e48
lang file modified
logboost Feb 3, 2016
47a131e
1fichier class fixed
logboost Feb 4, 2016
941018c
download limit added
logboost Feb 4, 2016
efb9331
Session bug fix
logboost Feb 5, 2016
7b29586
Ads configuration for free accounts added
logboost Feb 7, 2016
9101709
Logboost moved to SSL
logboost Feb 9, 2016
493e996
Fix skin inputs
Feb 14, 2016
caa727e
Fix skin inputs
Feb 14, 2016
699b6d6
Fix skin inputs
Feb 14, 2016
cd05136
Add french language (20% not finished)
Feb 14, 2016
58bd3fb
French language added (100% finished)
Feb 15, 2016
cf81062
French language added (100% finished)
Feb 15, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
data/
84 changes: 82 additions & 2 deletions class.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
date_default_timezone_set('UTC');
/*
* Home page: http://vinaget.us
* Blog: http://blog.vinaget.us
Expand All @@ -22,6 +23,7 @@ function config()
$this->self = 'http://' . $_SERVER['HTTP_HOST'] . preg_replace('/\?.*$/', '', isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $_SERVER['PHP_SELF']);
$this->Deny = true;
$this->admin = false;
$this->logboostSession = null ;
$this->fileinfo_dir = "data";
$this->filecookie = "/cookie.dat";
$this->fileconfig = "/config.dat";
Expand All @@ -48,7 +50,19 @@ function config()
foreach($password as $login_vng) if (isset($_COOKIE["secureid"]) && $_COOKIE["secureid"] == md5($login_vng)) {
$this->Deny = false;
break;
} else
// Access granted without password
if (isset($_COOKIE["accessmethod"]) && $_COOKIE["accessmethod"] == "freeaccess") {
$this->Deny = false ;
} else
// Access granted to Logboost users
if (isset($_COOKIE["accessmethod"]) && $_COOKIE["accessmethod"] == "logboost" && isset($_SESSION['LOGBOOST'])) {
$this->logboostSession = unserialize($_SESSION['LOGBOOST']) ;
if($this->logboostSession->sid != null) {
$this->Deny = false ;
}
}

}
$this->set_config();
if (!file_exists($this->fileinfo_dir)) {
Expand Down Expand Up @@ -90,6 +104,8 @@ function set_config(){
$this->file_size_limit = $this->config['file_size_limit'];
$this->zlink = $this->config['ziplink'];
$this->link_zip = $this->config['apiadf'];
$this->use_ads = $this->config['useads'];
$this->link_ads = $this->config['apiads'];
$this->link_rutgon = $this->config['apirutgon'];
$this->Googlzip = $this->config['Googlzip'];
$this->googlapikey = $this->config['googleapikey'];
Expand All @@ -114,6 +130,18 @@ function set_config(){
$this->proxy = false;
$this->prox = $_POST['proxy'];
$this->bbcode = $this->config['bbcode'];
$this->logboost_max_size_default = $this->config['logboost_max_size_default'];
if(isset($this->logboostSession) && $this->logboostSession->isPremium()) {
$this->max_jobs_per_ip = $this->config['logboost_max_jobs_per_ip'];
$this->max_size_default = $this->config['logboost_max_size_default'];
$this->file_size_limit = $this->config['logboost_file_size_limit'];
$this->limitPERIP = $this->config['logboost_limitPERIP'];
$this->limitMBIP = $this->config['logboost_limitMBIP'];
$this->max_jobs = $this->config['logboost_max_jobs'];
$this->max_load = $this->config['logboost_max_load'];
$this->logboost_secret = $this->config['logboost_secret'];
$this->logboost_client_id = $this->config['logboost_client_id'];
}
}
function isadmin(){
return (isset($_COOKIE['secureid']) && $_COOKIE['secureid'] == md5($this->config['admin']) ? true : $this->admin);
Expand All @@ -127,6 +155,7 @@ function notice($id="notice")
if($id=="notice") return sprintf($this->lang['notice'], Tools_get::convert_time($this->ttl * 60) , $this->limitPERIP, Tools_get::convert_time($this->ttl_ip * 60));
else {
$this->CheckMBIP();
$totalall = Tools_get::convertmb($this->totalMB * 1024 * 1024);
$MB1IP = Tools_get::convertmb($this->countMBIP * 1024 * 1024);
$thislimitMBIP = Tools_get::convertmb($this->limitMBIP * 1024 * 1024);
$maxsize = Tools_get::convertmb($this->max_size_other_host * 1024 * 1024);
Expand All @@ -143,6 +172,8 @@ function notice($id="notice")
if($id=="maxload") return' '.$this->get_load().' (max '.$this->max_load.') ';
if($id=="uonline") return $this->lang['uonline'];
if($id=="useronline") return Tools_get::useronline();
if($id=="total") return $this->lang['total_consumed'] ;
if($id=="totalall") return $totalall ;
}
}
function load_jobs()
Expand Down Expand Up @@ -255,7 +286,10 @@ function load_account(){
if(!$host['alias']){
if(empty($this->acc[$site]['proxy'])) $this->acc[$site]['proxy'] = "";
if(empty($this->acc[$site]['direct'])) $this->acc[$site]['direct'] = false;
if(empty($this->acc[$site]['logboost_only'])) $this->acc[$site]['logboost_only'] = false;
if(empty($this->acc[$site]['max_size'])) $this->acc[$site]['max_size'] = $this->max_size_default;
if(empty($this->acc[$site]['download_limit'])) $this->acc[$site]['download_limit'] = 0;
if(empty($this->acc[$site]['logboost_max_size'])) $this->acc[$site]['logboost_max_size'] = $this->logboost_max_size_default;
if(empty($this->acc[$site]['accounts'])) $this->acc[$site]['accounts'] = array();
}
}
Expand Down Expand Up @@ -376,6 +410,7 @@ function stream_get()
}
function download($hash)
{
session_write_close() ;
error_reporting(0);
$job = $this->lookup_job($hash);
if (!$job) {
Expand Down Expand Up @@ -553,23 +588,28 @@ function downloadmega($hash)

function CheckMBIP()
{
$this->countMBSiteIP = [] ;
$this->totalMBSite = [] ;
$this->countMBIP = 0;
$this->totalMB = 0;
$this->timebw = 0;
$timedata = time();
foreach($this->jobs as $job) {
if ($job['ip'] == $_SERVER['REMOTE_ADDR']) {
$this->countMbSiteIP[$job['site']] += $job['size'] / 1024 / 1024;
$this->countMBIP = $this->countMBIP + $job['size'] / 1024 / 1024;
if ($job['mtime'] < $timedata) $timedata = $job['mtime'];
$this->timebw = $this->ttl * 60 + $timedata - time();
}

if ($this->privatef == false) {
$this->totalMBSite[$job['site']] += $job['size'] / 1024 / 1024;
$this->totalMB = $this->totalMB + $job['size'] / 1024 / 1024;
$this->totalMB = round($this->totalMB);
}
else {
if ($job['owner'] == $this->owner) {
$this->totalMBSite[$job['site']] += $job['size'] / 1024 / 1024;
$this->totalMB = $this->totalMB + $job['size'] / 1024 / 1024;
$this->totalMB = round($this->totalMB);
}
Expand Down Expand Up @@ -784,6 +824,7 @@ function get($url)
$this->reserved = array();
$this->CheckMBIP();
$dlhtml = '';

if (count($this->jobs) >= $this->max_jobs) {
$this->error1('manyjob');
}
Expand Down Expand Up @@ -821,6 +862,7 @@ function get($url)
}
}


if (!$link) {
$domain = str_replace("www.", "", $this->cut_str($Original, "://", "/"));
if(strpos($domain, "1fichier.com")) $domain = "1fichier.com";
Expand All @@ -835,6 +877,16 @@ function get($url)
$link = $download->General($url);
}
}

// If download limit reached for this host
if($this->acc[$site]['download_limit'] > 0 && $this->totalMBSite[$site] > $this->acc[$site]['download_limit']) {
$this->error2('download_limit_reached', $Original);
}

// If user use a free account and account is premium only
if((!isset($this->logboostSession) || !$this->logboostSession->isPremium()) && $this->acc[$site]['logboost_only']) {
$this->error2('premium_only', $Original);
}

if (!$link) {
$this->proxy = isset($this->acc[$site]['proxy']) ? $this->acc[$site]['proxy'] : false;
Expand All @@ -851,12 +903,18 @@ function get($url)
$filesize = $size_name[0];
$filename = isset($this->reserved['filename']) ? $this->reserved['filename'] : $size_name[1];
}

$hosting = Tools_get::site_hash($Original);
if (!isset($filesize)) {
$this->error2('notsupport', $Original);
}
$this->max_size = $this->acc[$site]['max_size'];
// If user use a logboost acount, use specific max size by default
if(isset($this->logboostSession) && $this->logboostSession->isPremium()) {
$this->max_size = $this->acc[$site]['logboost_max_size'];
} else {
$this->max_size = $this->acc[$site]['max_size'];
}

if (!isset($this->max_size)) $this->max_size = $this->max_size_other_host;
$msize = Tools_get::convertmb($filesize);
$hash = md5($_SERVER['REMOTE_ADDR'] . $Original);
Expand Down Expand Up @@ -893,6 +951,7 @@ function get($url)
'ip' => $_SERVER['REMOTE_ADDR'],
'type' => 'direct',
'proxy' => $this->proxy == false ? 0 : $this->proxy,
'site' => $site,
'directlink' => array(
'url' => urlencode($link) ,
'cookies' => $this->cookie,
Expand All @@ -910,6 +969,15 @@ function get($url)
else $linkdown = 'http://'.$sv_name.'index.php/'.$hosting.'/'.$job['hash'].'/'.urlencode($filename);
}
else $linkdown = 'http://'.$sv_name.'?file='.$job['hash'];

// Create ads link before to zip it (free account only)
if(!isset($this->logboostSession) || !$this->logboostSession->isPremium()) {
if($this->use_ads && !empty($this->link_ads)) {
$datalink = $this->curl($this->link_ads . $linkdown, '', '', 0);
if (preg_match('%(http:\/\/.++)%U', $datalink, $adslik)) $linkdown = trim($adslik[1]);
}
}

// #########Begin short link ############ // Short link by [email protected]
if (empty($this->zlink) == true && empty($link) == false && empty($this->Googlzip) == false && empty($this->bitly) == true) {
$datalink = $this->Googlzip($linkdown);
Expand Down Expand Up @@ -1112,6 +1180,7 @@ function mega($url)
'ip' => $_SERVER['REMOTE_ADDR'],
'type' => 'direct',
'proxy' => 0,
'site' => $site,
'directlink' => array(
'url' => urlencode($link) ,
'cookies' => $this->cookie,
Expand All @@ -1129,6 +1198,15 @@ function mega($url)
else $linkdown = 'http://'.$sv_name.'index.php/'.$hosting.'/'.$job['hash'].'/'.urlencode($filename);
}
else $linkdown = 'http://'.$sv_name.'?file='.$job['hash'];

// Create ads link before to zip it (free account only)
if(!isset($this->logboostSession) || !$this->logboostSession->isPremium()) {
if($this->use_ads && !empty($this->link_ads)) {
$datalink = $this->curl($this->link_ads . $linkdown, '', '', 0);
if (preg_match('%(http:\/\/.++)%U', $datalink, $adslik)) $linkdown = trim($adslik[1]);
}
}

// #########Begin short link ############ // Short link by [email protected]
if (empty($this->zlink) == true && empty($link) == false && empty($this->Googlzip) == false && empty($this->bitly) == true) {
$datalink = $this->Googlzip($linkdown);
Expand Down Expand Up @@ -1283,6 +1361,7 @@ function fulllist()
urldecode($job['filename']) ,
$job['size'],
$job['ip'],
$job['site'],
$job['msize'],
urldecode($job['directlink']['url']) ,
$job['proxy']
Expand Down Expand Up @@ -1437,6 +1516,7 @@ function renamejob()
'owner' => $job['owner'],
'ip' => $job['ip'],
'type' => 'direct',
'site' => $site,
'directlink' => array(
'url' => $job['directlink']['url'],
'cookies' => $job['directlink']['cookies'],
Expand Down
17 changes: 17 additions & 0 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
$config['ziplink'] = false;
$config['apiadf'] = "http://api.adf.ly/api.php?key=94793cf6c45d36ed3d008d098fcfb964&uid=343503&advert_type=int&domain=adf.ly&url="; //http://adfoc.us/api/?key=31d0604803eec636ed3ffac5a1364c6e&url=
$config['apirutgon'] = "http://bc.vc/api.php?key=10bf5c6f0db2a00780a91aaa18745a14&uid=37018&url=";
// Additional config
$config['useads'] = false ;
$config['apiads'] = "" ;

$config['Googlzip'] = false;
$config['googleapikey'] = 'AIzaSyBzbeSDQoOYKUDLr1v5FOuZRtKwnqEOXxM';
$config['bitly'] = false;
Expand All @@ -42,4 +46,17 @@
$config['badword'] = "porn, sex, hentai, xxx, jav";
$config['language'] = "english";
$config['skin'] = "default";

// Logboost config

$config['logboost_max_jobs_per_ip'] = 1000;
$config['logboost_max_size_default'] = 2048;
$config['logboost_file_size_limit'] = 2050;
$config['logboost_limitPERIP'] = 100;
$config['logboost_limitMBIP'] = 1000 * 1024;
$config['logboost_max_jobs'] = 5000;
$config['logboost_max_load'] = 50 ;
$config['logboost_secret'] = "";
$config['logboost_client_id'] = "" ;

?>
Empty file removed data/account.dat
Empty file.
Empty file removed data/config.dat
Empty file.
Empty file removed data/cookie.dat
Empty file.
1 change: 0 additions & 1 deletion data/files/index.php

This file was deleted.

1 change: 0 additions & 1 deletion data/index.php

This file was deleted.

Empty file removed data/log.txt
Empty file.
Empty file removed data/online.dat
Empty file.
11 changes: 5 additions & 6 deletions hosts/1fichier_com.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
class dl_1fichier_com extends Download {

public function CheckAcc($cookie){
$data = $this->lib->curl("http://www.1fichier.com/en/console/abo.pl", $cookie, "");
if(stristr($data, "You are a premium user until")) return array(true, $this->lib->cut_str($data, "You are a premium user ","."));
$data = $this->lib->curl("https://1fichier.com/en/console/abo.pl", $cookie, "");
if(stristr($data, "Your account is already Premium.")) return array(true, $this->lib->cut_str($data, "Your subscription will end the ","."));
elseif(stristr($data, "You must be registered and logged in before subscribing")) return array(false, "accinvalid");
else return array(false, "accfree");
}

public function Login($user, $pass){
$data = $this->lib->curl("https://www.1fichier.com/en/login.pl", "", "mail={$user}&pass={$pass}&lt=on&Login=Login");
$data = $this->lib->curl("https://1fichier.com/en/login.pl", "", "mail={$user}&pass={$pass}&lt=on&Login=Login");
$cookie = $this->lib->GetCookies($data);
return $cookie;
return $cookie;
}

public function Leech($url) {
$data = $this->lib->curl($url, $this->lib->cookie, "");
$data = $this->lib->curl($url, $this->lib->cookie, "did=0");
if(stristr($data, "The requested file could not be found")) $this->error("dead", true, false, 2);
elseif($this->isredirect($data)) return trim($this->redirect);
return false;
}

}

/*
Expand Down
13 changes: 10 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php
ob_start();

include("lib/logboost-api-php/LogboostAPI.php") ;
/*
* Home page: http://vinaget.us
* Blog: http://blog.vinaget.us
Expand All @@ -16,7 +19,6 @@
$using = isset($_COOKIE['using']) ? $_COOKIE['using'] : 'default';
$using = isset($_REQUEST['using']) ? $_REQUEST['using'] : $using;
setcookie('using', $using);
ob_start();
ob_implicit_flush(TRUE);
ignore_user_abort(0);
if (!ini_get('safe_mode')) set_time_limit(30);
Expand All @@ -31,12 +33,17 @@
$host = $obj->list_host;
$skin = "skin/{$obj->skin}";
error_reporting($obj->display_error ? E_ALL : 0);
if ($obj->Deny == false){
if(!$obj->isAdmin() && $_GET['id'] == "admin") {
$login_showadmin=true ;
include("{$skin}/login.php");
} else if ($obj->Deny == false) {
require_once("{$skin}/function.php");
if (isset($_POST['urllist'])) $obj->main();
elseif (isset($_GET['infosv'])) showStat();
elseif (!isset($_POST['urllist'])) include("{$skin}/index.php");
}
else include("{$skin}/login.php");
else {
include("{$skin}/login.php");
}
ob_end_flush();
?>
25 changes: 24 additions & 1 deletion lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,30 @@
'notsupportacc' => 'Not support account, use cookie instead',
'notsupportpass'=> 'Not support password currently for %1$s',
'checkacc' => 'Check %1$s account',
'noplugin' => 'You don\'t have %s account checker.<br/>Ask someone to make it'
'noplugin' => 'You don\'t have %s account checker.<br/>Ask someone to make it',

'download_limit_reached' => 'Download limit reached for this host',
'connect_logboost' => 'Connect with logboost',
'free_access' => 'Free access',
'premium_access' => 'Premium access',
'ads' => 'Ads',
'no_ads' => 'No ads',
'gb_max' => 'Gb max',
'parralel_jobs' => 'Parallel jobs',
'hosters_available' => 'Hosters available',
'shared_download_limit' => 'Shared download limit',
'no_shared_download_limit' => 'No shared download limit',
'connect_logboost' => 'Connect with logboost',
'please_login' => 'Please login',
'please_choose_plan' => 'Please choose your plan',
'logboost_not_activated' => 'Your Logboost account is not activated, activate your logboost account and reconnect to use premium features.',
'warning' => 'Warning',
'premium_only' => 'Premium only',
'total_consumed' => 'Total consumed:',
'all_hosters' => 'All Hosters',
'stats' => 'stats',
'available_free' => 'Available for free',
'available_premium' => 'Available for premium only'
);
/*
* Open Source Project
Expand Down
Loading