/** * Bypasses CloudFlare and returns cf clearance cookie * * @param string $siteLink Site Host Link * @param string $response CloudFlare DDoS page * * @return string - Clearance Cookie */ public function bypass($siteLink, $response) { // get website host $siteHost = $this->getSiteHost($siteLink); // get cf answer if ($cfAnswer = $this->getAnswer($siteHost, $response)) { // attempt to solve cf equation $cfVerify = $siteHost . '/cdn-cgi/l/chk_jschl?jschl_vc=' . $cfAnswer['jschl_vc'] . '&pass='******'+', '%2', $cfAnswer['pass']) . '&jschl_answer=' . $cfAnswer['answer']; $cfVerify = Fetch::getPage($cfVerify); // if refresh cookie exists if (!($cfClearance = Fetch::getPageCookie($cfVerify, 'cf_clearance'))) { // if maximum amount of attempts has not exceeded if ($this->cfLevel < 5) { $cfClearance = bypass($siteLink, $response); } else { return false; } } if (!$cfClearance) { return false; } // store cf user id $cfUserId = Fetch::getPageCookie($cfVerify, '__cfduid'); // return clearance cookie return $cfClearance . $cfUserId; } }
public function __construct($path, $url, $voice = null) { parent::__construct(); //voice was checked in fetcher. this class is for saving on code, not avoiding coupling. $this->path = $path; $this->url = $url; $this->badInit = !file_exists($this->path); }
public function run() { DB::table('Larafuse')->truncate(); $columns = Fetch::getColumnsWithCustom(); foreach ($columns as $column) { Larafuse::create($column); } // Duplicated 'ContactId' in RecurringOrderWithContact table // manually deleted from Table Documentation // Id rearrange : Company,Contact,DataFormField,User }
public function __construct($voice, $path, $url, $text, $errorText) { parent::__construct(); //voice was checked in fetcher. this class is for saving on code, not avoiding coupling. $this->voice = $voice; $this->setText($text); $this->path = $path; $this->url = $url; $this->errorText = $errorText; $this->mp3 = $this->getMP3NameFromText($this->text); //path should be of the form base . service . voice $this->badInit = $this->setPath($this->path); }
function render() { $newest = $_REQUEST['newest']; $fetch = new Fetch($this->db); $fetch->get(); $query = 'SELECT COUNT(*) FROM lylina_items'; if ($this->auth->check()) { $query .= ' INNER JOIN (lylina_userfeeds) ON (lylina_items.feed_id = lylina_userfeeds.feed_id)'; } $query .= ' WHERE id > ? AND UNIX_TIMESTAMP(dt) > UNIX_TIMESTAMP()-(8*60*60)'; if ($this->auth->check()) { $query .= ' AND lylina_userfeeds.user_id = ?'; } $result = $this->db->GetRow($query, array($newest, $this->auth->getUserId())); if ($result) { $count = $result['COUNT(*)']; } else { $count = 0; } $render = new Render(); $render->assign('count', $count); $render->display('update.tpl'); }
function execute($data = null) { if (isset($this->curl[CURLOPT_POST]) && $this->curl[CURLOPT_POST]) { return parent::Execute(); } $cache = $this->cache; $url = $this->curl[CURLOPT_URL]; $ret = $cache::Get($url); if ($ret) { return $ret; } $ret = parent::Execute($data); $cache::Set($ret, $url); return $ret; }
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" > <div class="col-md-offset-3 col-md-6 col-lg-6 col-lg-offset-3" > <div class="thumbnail" > <div class="caption"> <h3>UPDATE PROFILE</h3> <form class="form" id="form-profile"> <div class="form-group"> <?php class Fetch extends dbConnection { public function __construct() { parent::__construct(); } } $db = new Fetch(); $sql = "select *from user where user_id = '" . $_SESSION['id'] . "'"; $rs = mysqli_query($db->getLink(), $sql); $user = ""; $pass = ""; $fname = ""; $lname = ""; $birthday = ""; $email = ""; $address = ""; $tel = ""; while ($row = mysqli_fetch_array($rs)) { $user = $row['username']; $pass = $row['password']; $fname = $row['firstname']; $lname = $row['lastname'];
static function fetch($url) { $http = new Fetch($url); $obj = $http->Execute(); return $obj->getContent(); }
function import($render) { $xml = new XMLReader(); $xml->open($_FILES['opml']['tmp_name']); while ($xml->read()) { if ($xml->nodeType == XMLReader::ELEMENT && $xml->localName == 'outline' && $xml->getAttribute('type') == 'rss') { $feed = $xml->getAttribute('xmlUrl'); $title = $xml->getAttribute('text'); $this->db->Execute('INSERT IGNORE INTO lylina_feeds (url, name) VALUES (?, ?)', array($feed, $title)); $this->db->Execute('INSERT IGNORE INTO lylina_userfeeds (feed_id, user_id, feed_name) VALUES ((select id from lylina_feeds where url = ?), ?, ?)', array($feed, $this->auth->getUserId(), $title)); } } $fetch = new Fetch($this->db); $fetch->get(); header('Location: admin'); }
public function __construct($client_id, $tag) { PostType::setup(); Fetch::setup(); APIEndpoint::create($client_id, $tag); }
}); Route::get('{table}', 'Sairiz\\Larafuse\\Controllers\\TablesController@index'); Route::get('{table}/create', 'Sairiz\\Larafuse\\Controllers\\TablesController@create'); Route::post('{table}', 'Sairiz\\Larafuse\\Controllers\\TablesController@store'); Route::get('{table}/{Id}', 'Sairiz\\Larafuse\\Controllers\\TablesController@show'); Route::get('{table}/{Id}/edit', 'Sairiz\\Larafuse\\Controllers\\TablesController@edit'); Route::put('{table}/{Id}', 'Sairiz\\Larafuse\\Controllers\\TablesController@update'); Route::patch('{table}/{Id}', 'Sairiz\\Larafuse\\Controllers\\TablesController@update'); Route::delete('{table}/{Id}', 'Sairiz\\Larafuse\\Controllers\\TablesController@destroy'); }); Route::group(array('prefix' => 'generate'), function () { Route::get('scaffold/{table?}', function ($table = null) { if (isset($table)) { Generate::genScaffComm(ucfirst($table)); } else { $tables = Fetch::getTables(); foreach ($tables as $table) { Generate::genScaffComm($table); echo '<br /><br />'; } } }); Route::get('customschema', function () { return Generate::genSchemaCustomColumns(); }); Route::get('getdatefunction', function () { return Generate::genGetDateFunction(); }); Route::get('setdatefunction', function () { return Generate::genSetDateFunction(); });