public function execute() { GWF_Website::plaintext(); GWF3::setConfig('store_last_url', false); $lat = $this->module->lat(); $lon = $this->module->lon(); $descr = trim(Common::getGetString('pp_descr')); $descr = $descr === '' ? null : $descr; $id = Common::getGetInt('pp_id', 0); $user = GWF_User::getStaticOrGuest(); $uid = $user->getID(); if (!GWF_ProfilePOI::changeAllowed($id, $uid)) { $this->module->ajaxError('Permission error!'); } $count = $id === 0 ? GWF_ProfilePOI::getPOICount($uid) : 0; $max_pois = $this->module->cfgAllowedPOIs(); if ($count >= $max_pois) { $this->module->ajaxErr('err_poi_exceed'); } $poi = new GWF_ProfilePOI(array('pp_id' => $id, 'pp_uid' => $uid, 'pp_lat' => $lat, 'pp_lon' => $lon, 'pp_descr' => $descr)); $poi->replace(); $data = $poi->getGDOData(); $data['user_name'] = $user->getVar('user_name'); die(json_encode($data)); }
public function execute() { GWF3::setConfig('store_last_url', false); if (false !== ($error = $this->sanitize())) { return $error; } return $this->imageButton(); }
public function execute() { GWF3::setConfig('store_last_url', false); if (false !== ($error = $this->validate())) { return $error; } return $this->templateGraph(); }
public function execute() { // $iso = Common::getGet('iso', 'en'); // if (false === ($lang = GWF_Language::getByISO($iso))) { // $lang = GWF_Language::getEnglish(); // } GWF3::setConfig('store_last_url', false); $lang = GWF_Language::getCurrentLanguage(); return $this->templateFeed($lang); }
public function execute() { GWF3::setConfig('log_request', false); $back = array(); $user = GWF_User::getStaticOrGuest(); $back['news'] = (int) $this->module->getNewsCount(); $back['pm'] = (int) WC_HTML::getUnreadPMCount($user); $back['links'] = (int) WC_HTML::getUnreadLinksCount($user); $back['forum'] = (int) WC_HTML::getUnreadThreadCount($user); return json_encode($back); }
public function execute() { GWF3::setConfig('store_last_url', false); if ('totalscore' === ($type = Common::getGet('type'))) { return $this->graphUserLevel('userhist_totalscore'); } if ('rank' === ($type = Common::getGet('type'))) { return $this->graphUserLevel('userhist_rank'); } return GWF_HTML::err('ERR_GENERAL', array(__FILE__, __LINE__)); }
public function execute() { GWF_Website::plaintext(); GWF3::setConfig('store_last_url', false); $id = Common::getGetInt('pp_id'); if (!GWF_ProfilePOI::changeAllowed($id, GWF_Session::getUserID())) { $this->module->ajaxError('Permission error!'); } GDO::table('GWF_ProfilePOI')->deleteWhere("pp_id = {$id}"); die("{$id}"); }
public function execute() { GWF_Website::plaintext(); GWF3::setConfig('store_last_url', false); if (!$this->module->canReadPOIs()) { return $this->module->ajaxErr('err_poi_read_perm'); } $minlat = $this->module->lat('minlat'); $maxlat = $this->module->lat('maxlat'); $minlon = $this->module->lon('minlon'); $maxlon = $this->module->lon('maxlon'); $where_perms = GWF_ProfilePOI::wherePermissions(); $where_place = GWF_ProfilePOI::whereLocations($minlat, $maxlat, $minlon, $maxlon); $where = "({$where_perms}) AND ({$where_place})"; $joins = array('users', 'profiles', 'whitelist'); $result = GDO::table('GWF_ProfilePOI')->selectAll('pp_id, pp_uid, user_name, pp_lat, pp_lon, pp_descr', $where, '', $joins); die(json_encode($result)); }
public function execute() { # Don't store this url. GWF3::setConfig('store_last_url', false); # Load the Captcha class require GWF_CORE_PATH . 'inc/3p/Class_Captcha.php'; # disable Logging GWF3::setConfig('log_request', false); # disable HTTP Caching GWF_HTTP::noCache(); # Setup Font, Color, Size $aFonts = $this->module->cfgCaptchaFont(); $rgbcolor = $this->module->cfgCaptchaBG(); $width = $this->module->cfgCaptchaWidth(); $height = $this->module->cfgCaptchaHeight(); $oVisualCaptcha = new PhpCaptcha($aFonts, $width, $height, $rgbcolor); # Output the captcha die($oVisualCaptcha->Create('', Common::getGetString('chars', true))); }
public function execute() { GWF3::setConfig('log_request', false); $_GET['ajax'] = 1; $cut = time() - GWF_ONLINE_TIMEOUT; $user = new GWF_User(); $table = GDO::table('GWF_Session'); $profiles = ''; if (false === ($result = $table->select('sess_user,user_name,user_options,user_level', "sess_time>={$cut}", 'user_name ASC', array('user')))) { return; } $guest = 0; $member = 0; $total = 0; $u_count = array(); $u_users = array(); while (false !== ($row = $table->fetch($result, GDO::ARRAY_A))) { $total++; $uid = $row['sess_user']; if ($uid == 0) { $guest++; continue; } $member++; $user->setGDOData($row); if ($user->isOptionEnabled(GWF_User::HIDE_ONLINE)) { continue; } if (isset($u_count[$uid])) { $u_count[$uid]++; } else { $u_count[$uid] = 1; $u_users[$uid] = $user->displayProfileLink(); } } $table->free($result); foreach ($u_count as $uid => $cnt) { $multi = $cnt > 1 ? "(x{$cnt})" : ''; $profiles .= ', ' . $u_users[$uid] . $multi; } $profiles = $profiles === '' ? '.' : ': ' . substr($profiles, 2) . '.'; return sprintf('%s Online%s', $total, $profiles); }
public function sendTheFile(GWF_Download $dl) { GWF3::setConfig('store_last_url', false); $realpath = $dl->getCustomDownloadPath(); # http header $mime = $dl->getVar('dl_mime'); # currently i am looking for pecl filetype? $mime = 'application/octet-stream'; # not sure about... header("Content-Type: {$mime}"); # about ... mime // $name = $dl->getVar('dl_filename'); # filename is sane. No " is allowed in filename. $name = $dl->getCustomDownloadName(); header("Content-Disposition: attachment; filename=\"{$name}\""); # drop attachment? $size = filesize($realpath); header("Content-Length: {$size}"); # Print file and die echo file_get_contents($realpath); die(0); }
public function execute() { # Do not remember this "non 200" page GWF3::setConfig('store_last_url', false); return $this->templateError(); }
public function execute() { GWF3::setConfig('store_last_url', false); return $this->graph(Common::getGet('site'), Common::getGet('type')); }