$default_country = getDefaultCountry($usr, $lang);
 if (isset($_REQUEST['newcache_info'])) {
     $newcache_info = $_REQUEST['newcache_info'];
 } else {
     $newcache_info = 1;
 }
 if ($newcache_info == 1) {
     // display info about register new cache
     $tplname = 'newcache_info';
 } else {
     //set here the template to process
     $tplname = 'newcache';
 }
 require_once $rootpath . '/lib/caches.inc.php';
 require_once $stylepath . '/newcache.inc.php';
 $rs = sql("SELECT `hide_flag` as hide_flag, `verify_all` as verify_all FROM `user` WHERE `user_id` =  " . $user->getUserId());
 $record = sql_fetch_array($rs);
 $hide_flag = $record['hide_flag'];
 $verify_all = $record['verify_all'];
 if ($hide_flag == 10) {
     // user is banned for creating new caches for some reason
     $tplname = 'newcache_forbidden';
     require_once $rootpath . '/lib/caches.inc.php';
 }
 // display info for begginner about number of find caches to possible register first cache
 $rsnfc = sql("SELECT COUNT(`cache_logs`.`cache_id`) as num_fcaches FROM cache_logs,caches WHERE cache_logs.cache_id=caches.cache_id AND (caches.type='1' OR caches.type='2' OR caches.type='3' OR caches.type='7' OR caches.type='8') AND cache_logs.type='1' AND cache_logs.deleted='0' AND `cache_logs`.`user_id` = " . sql_escape($usr['userid']) . "");
 $rec = sql_fetch_array($rsnfc);
 $num_find_caches = $rec['num_fcaches'];
 tpl_set_var('number_finds_caches', $num_find_caches);
 if ($num_find_caches < $NEED_FIND_LIMIT && !$user->isIngnoreGeocacheLimitWhileCreatingNewGeocache()) {
     $tplname = 'newcache_beginner';
Beispiel #2
0
 $default_country = getDefaultCountry($usr, $lang);
 if (isset($_REQUEST['newcache_info'])) {
     $newcache_info = $_REQUEST['newcache_info'];
 } else {
     $newcache_info = 1;
 }
 if ($newcache_info == 1) {
     // display info about register new cache
     $tplname = 'newcache_info';
 } else {
     //set here the template to process
     $tplname = 'newcache';
 }
 require_once $rootpath . '/lib/caches.inc.php';
 require_once $stylepath . '/newcache.inc.php';
 $rs = XDb::xSql("SELECT `hide_flag` as hide_flag, `verify_all` as verify_all FROM `user`\n            WHERE `user_id` = ? ", $user->getUserId());
 $record = XDb::xFetchArray($rs);
 $hide_flag = $record['hide_flag'];
 $verify_all = $record['verify_all'];
 if ($hide_flag == 10) {
     // user is banned for creating new caches for some reason
     $tplname = 'newcache_forbidden';
     require_once $rootpath . '/lib/caches.inc.php';
 }
 // display info for begginner about number of find caches to possible register first cache
 $num_find_caches = XDb::xMultiVariableQueryValue("SELECT COUNT(`cache_logs`.`cache_id`) as num_fcaches FROM cache_logs, caches\n            WHERE cache_logs.cache_id=caches.cache_id AND (caches.type='1'\n                OR caches.type='2' OR caches.type='3' OR caches.type='7'\n                OR caches.type='8') AND cache_logs.type='1'\n                AND cache_logs.deleted='0' AND `cache_logs`.`user_id` = :1 ", 0, $usr['userid']);
 tpl_set_var('number_finds_caches', $num_find_caches);
 if ($num_find_caches < $NEED_FIND_LIMIT && !$user->isIngnoreGeocacheLimitWhileCreatingNewGeocache()) {
     $tplname = 'newcache_beginner';
     require_once $rootpath . '/lib/caches.inc.php';
 }
 // force all caches to be verified - sql
 if (isset($_GET['verify_all'])) {
     if ($_GET['verify_all'] == 1 && $usr['admin']) {
         $sql = "UPDATE user SET verify_all = '1'  WHERE user_id = '" . intval($user_id) . "'";
         mysql_query($sql) or die(mysql_error());
     }
     if ($_GET['verify_all'] == 0 && $usr['admin']) {
         $sql = "UPDATE user SET verify_all = 0  WHERE user_id = " . intval($user_id);
         mysql_query($sql);
     }
 }
 // end force
 if (isset($_REQUEST['ignoreFoundLimit']) && $_REQUEST['ignoreFoundLimit'] != '') {
     $newIgnoreFoundLimit = intval($_REQUEST['ignoreFoundLimit']);
     $db = \lib\Database\DataBaseSingleton::Instance();
     $db->multiVariableQuery('INSERT INTO user_settings (user_id, newcaches_no_limit) VALUES (:2, :1) ON DUPLICATE KEY UPDATE newcaches_no_limit = :1', $newIgnoreFoundLimit, $user->getUserId());
     $db->reset();
     unset($user);
     $user = new \lib\Objects\User\User(array('userId' => $_REQUEST['userid']));
     $user->loadExtendedSettings();
 }
 if (isset($_GET['is_active_flag']) && $_GET['is_active_flag'] == 1 && $usr['admin']) {
     $sql = "UPDATE user SET is_active_flag = 1 - is_active_flag, `activation_code`='' WHERE user_id = " . intval($user_id);
     mysql_query($sql);
 }
 if ($usr['userid'] == $super_admin_id) {
     tpl_set_var('remove_all_logs', '<p><img src="tpl/stdstyle/images/blue/arrow2.png" alt="" align="middle" />&nbsp;&nbsp;<a href="removelog.php?userid=' . $user_id . '"><font color="#ff0000">' . tr('admin_users_remove_logs') . '</font></a>&nbsp;<img src="' . $stylepath . '/images/blue/atten-red.png" align="top" alt="" /></p>');
 } else {
     tpl_set_var('remove_all_logs', '');
 }
 if (checkField('countries', $lang)) {
Beispiel #4
0
         $record["verify_all"] = 1;
         lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $user_id, true, lib\Objects\User\AdminNote::VERIFY_ALL);
         XDb::xQuery($q);
     }
     if ($_GET['verify_all'] == 0 && $usr['admin']) {
         $q = "UPDATE user SET verify_all = 0  WHERE user_id = " . intval($user_id);
         lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $user_id, true, lib\Objects\User\AdminNote::NO_VERIFY_ALL);
         $record["verify_all"] = 0;
         XDb::xQuery($q);
     }
 }
 // end force
 if (isset($_REQUEST['ignoreFoundLimit']) && $_REQUEST['ignoreFoundLimit'] != '') {
     $newIgnoreFoundLimit = intval($_REQUEST['ignoreFoundLimit']);
     if ($newIgnoreFoundLimit == 1) {
         lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $user->getUserId(), true, lib\Objects\User\AdminNote::IGNORE_FOUND_LIMIT);
     } else {
         lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $user->getUserId(), true, lib\Objects\User\AdminNote::IGNORE_FOUND_LIMIT_RM);
     }
     $db = OcDb::instance();
     $db->multiVariableQuery('INSERT INTO user_settings (user_id, newcaches_no_limit) VALUES (:2, :1) ON DUPLICATE KEY UPDATE newcaches_no_limit = :1', $newIgnoreFoundLimit, $user->getUserId());
     $user = new \lib\Objects\User\User(array('userId' => $_REQUEST['userid']));
     $user->loadExtendedSettings();
 }
 //ban
 if (isset($_GET['is_active_flag']) && $_GET['is_active_flag'] == 1 && $usr['admin']) {
     $q = "UPDATE user SET is_active_flag = 1 - is_active_flag, `activation_code`='' WHERE user_id = " . intval($user_id);
     if ($record["is_active_flag"] == 0) {
         $record["is_active_flag"] = 1;
         lib\Objects\User\AdminNote::addAdminNote($usr['userid'], $user_id, true, lib\Objects\User\AdminNote::UNBAN);
     } else {