Exemple #1
0
 function atoi($s)
 {
     if (isnumber($s)) {
         return $s;
     }
     return 0;
 }
Exemple #2
0
 function WT_ProblemAddTag()
 {
     $id = $_POST['id'];
     $tag = trim($_POST['tag']);
     if (!isnumber($id) || $tag == '') {
         print '-ERR';
         return;
     }
     $gw = WT_spawn_new_gateway();
     if ($gw->current_lib->IPC_Problem_AddTag($id, $tag)) {
         print '+OK';
     } else {
         print '-ERR';
     }
 }
Exemple #3
0
</label>
						<?php 
            }
            ?>
							
						</p>
					  </div>
					  <div class="col s4">
						<div class="input-field col s12">
							<input id="urutan" name="urutan" type="text" class="validate" maxlength="3" length="3" value="<?php 
            if ($a == 'ubah') {
                echo $d['urutan'];
            }
            ?>
" required <?php 
            echo isnumber();
            ?>
>
							<label for="urutan">Urutan</label>
						</div>
					  </div>
					</div>
					<button type="submit" class="btn waves-effect waves-light">Simpan</button>
				</form>
			</div>
<?php 
            break;
        case 'hapus':
            if (!isset($_GET['i']) or $_GET['i'] == '') {
                eksyen('', '?hal=link');
            }
 function RemoveTagFromProblem($problem_id, $tag)
 {
     $tag_id = db_field_value('tester_tags_dict', 'id', '`tag`="' . addslashes($tag) . '"');
     if (isnumber($tag_id)) {
         db_delete('tester_problem_tags', "`problem_id`={$problem_id} AND `tag_id`={$tag_id}");
         return true;
     } else {
         return false;
     }
 }
Exemple #5
0
 function setNodeAccess($node, $access)
 {
     if (!isnumber($access)) {
         $access = 0;
     }
     if ($access < 0) {
         $access = 0;
     }
     if ($access > 7) {
         $access = 7;
     }
     return $this->setNodeField($node, 'access', $access);
 }
Exemple #6
0
function create_query_insert_text($table, $data, $fd)
{
    global $_POST;
    $fields = implode(',', $fd);
    $x = '';
    $r = array();
    $t = 0;
    foreach ($fd as $field) {
        if (array_key_exists($field, $_POST)) {
            $t = 1;
        }
        $v = array_key_exists($field, $_POST) ? $_POST[$field] : $data[$field];
        #echo "$field:${_POST[$field]}:${data[$field]}\n<br/>";
        if (!isnumber($v)) {
            $v = "\"{$v}\"";
        }
        $r[] = $v;
    }
    if (!$t) {
        return $t;
    }
    $values = implode(',', $r);
    $r = "insert into {$table} ({$fields}) values({$values})";
    return $r;
}
Exemple #7
0
 function Editor_SavePublication($formname = '')
 {
     global $id, $uid, $redirect;
     if ($id == '') {
         $id = $this->dbids[$this->uids[$uid]];
     }
     if (!isnumber($id)) {
         return;
     }
     if (!$this->GetAllowed('EDITINFO')) {
         return;
     }
     $r = db_row_value($this->settings['content'], '`id`=' . $id);
     $this->dataset->ReceiveData($formname);
     $cid = db_max($this->settings['content'], 'id', '`uid`=' . $uid);
     if ($this->CheckExistment($cid)) {
         if ($redirect != '') {
             redirect();
         }
         return;
     }
     $arr = $this->dataset->GetFieldValues(true);
     $arr['uid'] = $r['uid'];
     $arr['order'] = $r['order'];
     $arr['timestamp'] = time();
     $arr['user_id'] = '"' . user_id() . '"';
     $arr['ip'] = '"' . get_real_ip() . '"';
     db_insert($this->settings['content'], $arr);
     $this->dataset->FreeValues();
     $this->ReceiveContent();
     if ($redirect != '') {
         redirect();
     }
 }
Exemple #8
0
 function UpdateLimitSetting($arr, $title, $field, $sfield, $suff)
 {
     if ($_POST['cntset_' . $field . '_' . $suff]) {
         if (!isnumber($_POST['cntset_' . $field . '_' . $suff . '_val'])) {
             add_info('Некорректное ограничение файла в поле &laquo;' . $title . '&raquo;');
             return false;
         } else {
             $arr[$sfield] = $_POST['cntset_' . $field . '_' . $suff] . $_POST['cntset_' . $field . '_' . $suff . '_val'];
         }
     }
     return true;
 }
Exemple #9
0
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
?>
<div id="navigator"><a href="<?php 
echo config_get('document-root');
?>
/login">Вход в систему</a><a href="<?php 
echo config_get('document-root');
?>
/login/registration">Регистрация</a>Активация пользователя</div>
${information}
<?php 
global $id, $hash;
if (!isset($id) || !isnumber($id) || !isset($hash)) {
    add_info('Пропущен обязательный параметр.');
} else {
    $r = db_row_value('user', '`id`=' . $id);
    if ($r['authorized']) {
        add_info('Ошибка активации пользователя.');
    } else {
        if (md5($r['login'] . '##VERY_RANDOM_SEED##' . $r['email'] . '##' . $r['id']) != $hash) {
            add_info('Ошибка активации пользователя.');
        } else {
            add_info('Пользователь успешно активирован. Вход в систему с логином ' . $r['login'] . ' разрешен.');
            db_update('user', array('authorized' => 1));
        }
    }
}
Exemple #10
0
 function SetValue($v)
 {
     if (isnumber($v, true)) {
         $this->settings['value'] = $v;
     } else {
         $this->settings['value'] = 0;
     }
 }
Exemple #11
0
 function manage_template_receive_from_selector($name)
 {
     $res = $_POST[$name . '_script_selector'];
     if (!isnumber($res)) {
         $res = -1;
     }
     return $res;
 }