function wfitem($wf) { if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) { $wf->cp->baseico = true; $wf->cp->norobots(); $wf->cp->bodyclass = "admin_login"; } else { WRA::gotopage(WRA::base_url() . 'admin/login'); $wf->nicedie(); } $this->adminnodes = WRA_ENV::adminnodes(); for ($i = 0; $i < count($this->adminnodes); $i++) { if ($_REQUEST['node'] == $this->adminnodes[$i]->link) { $this->curnode = $this->adminnodes[$i]; $this->curadmin = new wfadmin($this->curnode->link); break; } } $this->art = json_decode(stripslashes($_REQUEST['ids'])); if (!is_array($this->art)) { $this->art = array(); $this->art[] = $_REQUEST['ids']; } $this->header = $this->curnode->name; if (!$this->curadmin->multilanguages) { $this->currows = $this->curadmin->getrows('', $this->page * $this->onpage, $this->onpage); } else { $this->currows = $this->curadmin->getrows('_' . WRA_CONF::$language, $this->page * $this->onpage, $this->onpage); } }
function run() { parent::run(); if ($_REQUEST['oauth_token']) { $connection = new TwitterOAuth(WRA_CONF::$twiappid, WRA_CONF::$twiappsecret, $_REQUEST['oauth_token'], $_REQUEST['oauth_verifier']); $token_credentials = $connection->getAccessToken($_REQUEST['oauth_verifier']); $connection = new TwitterOAuth(WRA_CONF::$twiappid, WRA_CONF::$twiappsecret, $token_credentials['oauth_token'], $token_credentials['oauth_token_secret']); $account = $connection->get('account/verify_credentials'); // WRA::debug($ctwe); if ($account) { // WRA::debug($user); $nu = new wra_twu(); $nu->display_name = htmlspecialchars($account->screen_name, ENT_QUOTES); //$user->name; $nu->regdate = WRA::getcurtime(); $nu->twuserid = $account->id; // $nu->userid = $usr; $nu->username = htmlspecialchars($account->name, ENT_QUOTES); $nu->usersurname = htmlspecialchars($user['last_name'], ENT_QUOTES); $nu->link = $account->url; //$user->link; $nu->user_agent = wra_fbu::getbrowser(); $nu->access_token = $token_credentials['oauth_token']; $nu->email = $token_credentials['oauth_token_secret']; $nu->photo = $account->profile_image_url; if ($account->notifications) { $nu->gender = 0; } else { $nu->gender = 1; } $nu->phone = ''; if (!empty($nu->twuserid)) { if (!wra_twu::istwexist($nu->twuserid)) { $nu->userid = $this->addUsr($nu->username, $nu->usersurname, $nu->phone, $nu->email, "asdf" . time(), $nu->photo); $nu->add(); } else { $nu->loadbytw($nu->twuserid); $nu->update(); } wra_twu::twd($nu->twuserid, $nu->userid); } if (empty($_SESSION['lastpage'])) { WRA::gotopage(WRA::base_url() . '?from=tw&show=no'); } else { WRA::gotopage(WRA::base_url() . $_SESSION['lastpage']); } $_SESSION['lastpage'] = ''; } } else { ?> <a href="<?php WRA::e(wra_twitter::loginLink()); ?> ">login</a><?php } }
function run() { $this->nofooter = true; $this->noheader = true; if (isset($_POST['btnclicked'])) { switch ($_POST['btnclicked']) { case 'btnfind': break; case 'btnAdd': WRA::gotopage(WRA::base_url() . $this->curnode->link . '/edit'); break; } } }
function run() { parent::run(); if (wra_userscontext::isloged($this->wf) || wra_u::islogin()) { WRA::gotopage(WRA::base_url()); return; } $this->wf->cp->ogtitle = 'Fresh ukrainian news on the map '; $this->wf->cp->ogname = 'Map of war in Ukraine'; $this->wf->cp->header = 'Map of Unrest in Ukraine'; $this->wf->cp->description = 'Fresh news from Ukraine on the map, event of summer 2014, war between Russia and Ukraine, beginning of Third World War. 2014 pro-Russian conflict in Ukraine '; $this->wf->cp->keywords = 'Ukraine, Russia, Donetsk, war, artillery, war games, provocations, intelligence, USA, Eastern Europe'; // $this->lastupdate= wra_foursqvenues::lastupdate(); }
function wfitem($wf) { //include WRA_Path. '/modules/admin/admintable.php'; //include WRA_Path.'/modules/admin/adminpages.php'; $this->header = 'Администрирование'; $this->adminnodes = WRA_ENV::adminnodes(); $this->noticecount = wra_adminnotices::getcount(); if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) { $wf->cp->baseico = true; $wf->cp->norobots(); $wf->cp->bodyclass = "admin_login"; } else { WRA::gotopage(WRA::base_url() . 'admin/login'); $wf->nicedie(); } // wra_adminnotices:: message('hello','hello'); }
function run() { $this->nofooter = true; $this->noheader = false; if (isset($_POST['admin_login'])) { $this->enter_try = -1; $isremember = false; if (isset($_POST['rememberme'])) { $isremember = true; } $login = addslashes($_POST['admin_login']); $pass = $_POST['admin_pass']; $this->enter_try = wra_userscontext::login($this->wf, $login, $pass, $isremember); } if (isset($_REQUEST['act'])) { // die($_REQUEST['act']); wra_userscontext::logout(); if (@$_REQUEST['backurl'] == 'index.php') { WRA::gotopage(''); $this->wf->nicedie(); } } if (wra_userscontext::isloged($this->wf)) { switch (@$_POST['returnurl']) { case 'admin': default: if (wra_userscontext::hasright('adminpage')) { WRA::gotopage(WRA::base_url() . 'admin'); $this->wf->nicedie(); } else { $this->enter_try = 3; } break; } } else { switch (@$_REQUEST['returnurl']) { case 'user': WRA::gotopage(WRA::base_url()); $this->wf->nicedie(); break; } } }
function run() { $this->nofooter = true; $this->noheader = true; if (isset($_POST['btnclicked'])) { switch ($_POST['btnclicked']) { case 'btnfind': break; case 'btnadd': WRA::gotopage(WRA::base_url() . $this->curnode->link . '/edit'); break; case 'btnSave': if ($this->curadmin->curid == -1) { if ($this->curadmin->multilanguages) { foreach ($this->wf->languages as $v) { $this->curadmin->addfirst('_' . $v->alias); } } else { $this->curadmin->addfirst(''); } WRA::gotopage(WRA::base_url() . $this->curnode->link); } else { if ($this->curadmin->multilanguages) { // WRA::debug($this->wf->languages); foreach ($this->wf->languages as $v) { // WRA::debug($v->alias); $this->curadmin->updatefirst('_' . $v->alias); } } else { $this->curadmin->updatefirst(''); } $this->load($this->wf); } break; } } }
function run() { WRA::gotopage(WRA::base_url()); // $this->wf->closedb(); // $this->wf->nicedie(); }
function doedit($wf) { $thisclass_string = wra_adminmenu::getbaseclass(); if ($thisclass_string != '') { eval('$thisclass=new ' . $thisclass_string . '($wf);'); if (!true) { WRA::gotopage('admin'); return; } if (wra_adminpage::isedit()) { $backurl = wra_adminmenu::getassoc(WRA::getcurpage()); if (!WRA::ir('id')) { WRA::gotopage($backurl); WRA::nicedie(); } if (!WRA::ir('type')) { $code = '$isexist=' . $thisclass_string . '::isexist($wf,' . WRA::r('id') . ');'; } else { $pid_class = wra_adminmenu::getclass(wra_adminmenu::getassoc(WRA::r('mod')) . '_' . WRA::r('type')); // echo $pid_class; $code = '$isexist=' . $pid_class . '::isexist($wf,' . WRA::r('id') . ');'; } eval($code); if (!$isexist && WRA::r('id') != -1) { WRA::gotopage($backurl); WRA::nicedie(); } } else { $backurl = WRA::getcurpage(); if (WRA::ir('pid')) { if (!WRA::ir('type')) { $code = '$isexist=' . $thisclass_string . '::isexist($wf,' . WRA::r('pid') . ');'; } else { $pid_class = wra_adminmenu::getclass(WRA::r('mod') . '_' . WRA::r('type')); // echo $pid_class; $code = '$isexist=' . $pid_class . '::isexist($wf,' . WRA::r('pid') . ');'; } eval($code); if (!$isexist) { WRA::gotopage($backurl); WRA::nicedie(); } } } $this->deletebyId($wf, $thisclass, $thisclass_string); } }
function run() { wra_userscontext::logout(); WRA::gotopage('../admin/login'); $this->wf->nicedie(); }
function run() { parent::run(); $code = $_REQUEST["code"]; if (!empty($code)) { // WRA::debug("get fb data"); $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . WRA_CONF::$fbappid . "&redirect_uri=" . urlencode(WRA_CONF::$fbauthlink . '') . "&client_secret=" . WRA_CONF::$fbappsecret . "&code=" . $code; // $usr = $_REQUEST['state']; $response = @file_get_contents($token_url); // WRA::debug($response); $params = null; parse_str($response, $params); // WRA::debug($params); $graph_url = "https://graph.facebook.com/me?fields=id,picture,name,first_name,location,hometown,gender,last_name,link,email&type=large&access_token=" . $params['access_token']; // WRA::debug($graph_url); $user = @json_decode(@file_get_contents($graph_url)); // WRA::debug('asdasda'); // wra_fbu::fbd($user->id); $nu = new wra_fbu(); $nu->display_name = htmlspecialchars($user->name, ENT_QUOTES); $nu->regdate = WRA::getcurtime(); $nu->fbuserid = $user->id; // $nu->userid = $usr; $nu->username = htmlspecialchars($user->first_name, ENT_QUOTES); $nu->usersurname = htmlspecialchars($user->last_name, ENT_QUOTES); $nu->link = htmlspecialchars($user->link, ENT_QUOTES); $nu->user_agent = wra_fbu::getbrowser(); $nu->access_token = $params['access_token']; $nu->email = htmlspecialchars($user->email, ENT_QUOTES); $nu->photo = str_replace("_q", "_n", $user->picture->data->url); if ($user->gender == 'female') { $nu->gender = 1; } else { $nu->gender = 0; } $nu->phone = ''; if (isset($nu->hometown)) { $nu->adres = htmlspecialchars($nu->hometown->name, ENT_QUOTES); } if (isset($nu->location)) { $nu->adres = htmlspecialchars($nu->location->name, ENT_QUOTES); } // WRA::debug($nu);die(); if (!empty($nu->fbuserid)) { if (!wra_fbu::isfbexist($user->id)) { $nu->userid = $this->addUsr($nu->display_name, $nu->usersurname, $nu->phone, $nu->email, "asdf" . time(), $nu->photo); $nu->add(); } else { $nu->loadbyfb($nu->fbuserid); $nu->update(); } wra_fbu::fbd($nu->fbuserid, $nu->userid); // try{ // }catch(Exception $ex){} //print_r($fb); } } // if(empty($_SESSION['lastpage'])){ WRA::gotopage(WRA::base_url() . '?from=fb'); // }else{ // WRA::gotopage(WRA::base_url().$_SESSION['lastpage']); // } $_SESSION['lastpage'] = ''; }