* @version 2.0 * @package Fiyo CMS * @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ define('_FINDEX_', 1); session_start(); if (!isset($_SESSION['USER_LEVEL']) and $_SESSION['USER_LEVEL'] > 2) { die; } require_once '../../../system/jscore.php'; $db = new FQuery(); $db->connect(); /****************************************/ /* Enable and Disbale User */ /****************************************/ if (isset($_GET['stat'])) { if ($_GET['stat'] == '1') { $db->update(FDBPrefix . 'user', array("status" => "1"), 'id=' . $_GET['id']); alert('success', Status_Applied, 1); } if ($_GET['stat'] == '0') { $db->update(FDBPrefix . 'user', array("status" => "0"), 'id=' . $_GET['id']); $db->delete(FDBPrefix . 'session_login', 'user_id=' . $_GET['id']); alert('success', Status_Applied, 1); } if ($_GET['stat'] == 'kick') { $db->delete(FDBPrefix . 'session_login', 'user_id=' . $_GET['id']); alert('success', Status_Applied, 1); } }
<?php /** * @version 1.5.0 * @package Fiyo CMS * @copyright Copyright (C) 2012 Fiyo CMS. * @license GNU/GPL, see LICENSE.txt * @description **/ define('_FINDEX_', 1); require_once '../../../system/jscore.php'; $db = new FQuery(); $db->connect(); $online = angka(FQuery('statistic_online')); $total = angka(FQuery('statistic')); $dtf = date('Y-m-d 00:00:00'); $today = angka(FQuery('statistic', "time >= '{$dtf}'", "", "", "time ASC")); $dtf = date('Y-m-d 00:00:00', strtotime("-1 Months")); $month = angka(FQuery('statistic', "time >= '{$dtf}'", "", "", "time ASC")); $timer = time() - 300; $db->delete(FDBPrefix . 'statistic_online', "time < {$timer}"); echo "\n{ \"today\":\"{$today}\" , \"month\":\"{$month}\", \"total\":\"{$total}\", \"online\":\"{$online}\" }";
* @copyright Copyright (C) 2014 Fiyo CMS. * @license GNU/GPL, see LICENSE. **/ if (!isset($_POST['user'])) { die('Access Denied!'); } session_start(); define('_FINDEX_', 1); require '../../../system/jscore.php'; $db = new FQuery(); $user = mysql_real_escape_string($_POST['user']); $sql = $db->select(FDBPrefix . "user", "*", "status=1 AND user='******' AND password='******'pass']) . "'"); $qr = mysql_fetch_array($sql); $jml = mysql_affected_rows(); if ($jml > 0) { $_SESSION['USER_ID'] = $qr['id']; $_SESSION['USER'] = $qr['user']; $_SESSION['USER_NAME'] = $qr['name']; $_SESSION['USER_EMAIL'] = $qr['email']; $_SESSION['USER_LEVEL'] = $qr['level']; $_SESSION['USER_LOG'] = $qr['time_log']; $time_log = date('Y-m-d H:i:s'); $db->update(FDBPrefix . 'user', array("time_log" => "{$time_log}"), "id={$qr['id']}"); $db->delete(FDBPrefix . "session_login", "user_id={$qr['id']}"); $qr = $db->insert(FDBPrefix . "session_login", array("{$qr['id']}", "{$qr['user']}", "{$qr['level']}", date('Y-m-d H:i:s'))); } if ($qr or !empty($_SESSION['USER_ID']) and $_SESSION['USER_LEVEL'] <= 3 and userInfo()) { echo "{ \"status\":\"1\" , \"alert\":\"" . alert('success', Login_Success) . "\"}"; } else { echo "{ \"status\":\"0\" , \"alert\":\"" . alert('error', Login_Error) . "\"}"; }
function multipleDelete($table, $source, $item = null, $cat = null, $except = null, $sub = null) { $db = new FQuery(); $del = explode(",", $source); if (!isset($except)) { $except = null; } else { $except = $except; } if (!empty($cat)) { $cat = $fid = $cat; } else { $cat = 'category'; $fid = 'id'; } if (isset($source)) { foreach ($del as $id) { if (!empty($item)) { if (!empty($except)) { $art = $db->select(FDBPrefix . "{$item}", '*', "{$except} AND {$cat} ='{$id}'"); } else { $art = $db->select(FDBPrefix . "{$item}", '*', "{$cat} ='{$id}'"); } if (@mysql_num_rows($art) > 0) { $noempty = 1; break; } if (!isset($noempty)) { if (!empty($sub)) { if (!oneQuery($table, 'parent_id', $id)) { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } else { $noempty = 1; } } else { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } } else { $noempty = 1; } } else { if (isset($sub)) { if (!oneQuery($table, 'parent_id', $id)) { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } else { $noempty = 1; } } else { $qr = $db->delete(FDBPrefix . $table, "{$fid}='{$id}'"); } } } } if (isset($qr)) { return 1; } else { if (isset($noempty)) { return 'noempty'; } else { return null; } } }
?> </th> <th style="width:1% !important;">ID</th> </tr> </thead> <tbody> <?php $db = new FQuery(); $db->connect(); if (isset($_POST['uninstall']) and !empty($_POST['folder'])) { $folder = $_POST['folder']; $a = $b = 'Null <br>'; if (delete_directory("../plugins/{$folder}")) { $a = "folder <i>folder/{$folder}</i> " . has_ben_deleted . ".<br>"; } $qr = $db->delete(FDBPrefix . 'plugins', "folder='{$folder}'"); $b = "tabel <i>{$folder}</i> " . has_ben_deleted . ".<br>"; alert('info', "{$a} {$b}"); } $dir = opendir("../plugins"); $no = 1; while ($folder = readdir($dir)) { if ($folder == "." or $folder == "..") { continue; } if (!preg_match("/[\\.]/i", $folder)) { $stat = oneQuery('plugin', 'folder', "'{$folder}'", 'status'); $plgid = oneQuery('plugin', 'folder', "'{$folder}'", 'id'); if ($stat == 1) { $stat1 = "selected"; $stat2 = "";
function delete_permalink($link) { $db = new FQuery(); $db->connect(); $db->delete(FDBPrefix . 'permalink', "permalink='{$link}'"); }
$db->insert(FDBPrefix . "session_login", array("{$qr['id']}", "{$qr['user']}", "{$qr['level']}", date('Y-m-d H:i:s'))); $sql = $db->select(FDBPrefix . "user", "*", "status=1 AND user='******'user']}' AND password='******'password']) . "'"); $qr = mysql_fetch_array($sql); $_SESSION['USER_ID'] = $qr['id']; $_SESSION['USER'] = $qr['USER']; $_SESSION['USER_NAME'] = $qr['name']; $_SESSION['USER_EMAIL'] = $qr['email']; $_SESSION['USER_LEVEL'] = $qr['level']; $_SESSION['USER_LOG'] = date('Y-m-d H:i:s'); redirect($linkUser); } else { if ($activator == 2 and $email) { define("userNotice", "need_email_activation"); } else { if (!$email) { $db->delete(FDBPrefix . "user", "user = '******'user']}'"); define("userNotice", alert("error", "Sorry, mail server error :(")); } } } } } else { define("userNotice", alert("error", user_Registration_Exists)); } } else { define("userNotice", alert("error", user_Security_Invalid)); } } } else { define("userNotice", alert("error", user_Please_Complete_Fields)); }
</thead> <?php $db = new FQuery(); $db->connect(); if (isset($_POST['uninstall']) and !empty($_POST['id'])) { $apps = $_POST['id']; $notice = $b = $c = ''; if (!empty($apps)) { if (delete_directory("apps/{$apps}")) { $notice .= "folder <i>apps/{$apps}</i> " . deleted . "!<br>"; } if (delete_directory("../apps/{$apps}")) { $notice .= "folder <i>apps/{$apps}</i> " . deleted . "!<br>"; } } $qr = $db->delete(FDBPrefix . 'apps', "folder='{$apps}'"); if ($qr) { $c = "table <i>{$apps}</i> " . deleted . "!<br>"; } alert('info', "{$notice}", true); } $sql = $db->select(FDBPrefix . 'apps', '*', '', "name ASC"); while ($qr = mysql_fetch_array($sql)) { $file = "../apps/{$qr['folder']}/app_details.php"; if (file_exists($file)) { include $file; } echo "<tr>"; if (!isset($app_desc)) { $app_desc = "Error Apps!"; $qr['name'] = "Error Apps!";
function load_login() { if (isset($_POST['fiyo_login'])) { $db = new FQuery(); $user = mysql_real_escape_string($_POST['user']); $sql = $db->select(FDBPrefix . "user", "*", "status=1 AND user='******' AND password='******'pass']) . "'"); $qr = mysql_fetch_array($sql); $jml = mysql_affected_rows(); if ($jml > 0) { $_SESSION['USER_ID'] = $qr['id']; $_SESSION['USER'] = $qr['user']; $_SESSION['USER_NAME'] = $qr['name']; $_SESSION['USER_EMAIL'] = $qr['email']; $_SESSION['USER_LEVEL'] = $qr['level']; $_SESSION['USER_LOG'] = $qr['time_log']; $time_log = date('Y-m-d H:i:s'); $db->update(FDBPrefix . 'user', array("time_log" => "{$time_log}"), "id={$qr['id']}"); $db->delete(FDBPrefix . "session_login", "user_id={$qr['id']}"); $qr = $db->insert(FDBPrefix . "session_login", array("{$qr['id']}", "{$qr['user']}", "{$qr['level']}", date('Y-m-d H:i:s'))); } if ($qr or !empty($_SESSION['USER_ID']) and $_SESSION['USER_LEVEL'] <= 3 and userInfo()) { redirect(getUrl()); } else { select_themes('login'); alert('error', Login_Error); } } else { if (isset($_GET['theme']) and $_GET['theme'] == 'blank') { echo "Redirecting..."; } else { select_themes('login'); } } }