Permalink
Browse files

Initial commit

  • Loading branch information...
AhmedElywa committed Oct 17, 2018
1 parent 8510e59 commit 73909d6978a46bd66c0b90cf8a907d86bc22d671
Showing 1,561 changed files with 141,236 additions and 0 deletions.
@@ -0,0 +1,3 @@
RewriteEngine on
RewriteCond $1 !^(index.php|assets)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
No changes.
No changes.
@@ -0,0 +1,58 @@
<?php
ob_start();
session_start();
// set page header
error_reporting(E_ALL);
@ini_set('magic_quotes_runtime', 0);
if ( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && substr_count( $_SERVER['HTTP_ACCEPT_ENCODING'], "gzip" ) )
{
ob_implicit_flush( 0 );
if ( @ob_start( array( "ob_gzhandler", 9 ) ) )
{
header( "Content-Encoding: gzip" );
}
}
header( "Date: ".gmdate( "D, d M Y H:i:s" )." GMT" );
header( "Last-Modified: ".gmdate( "D, d M Y H:i:s" )." GMT" );
// Init framwork core
require_once LIBRARY_DIR . "Loader.php";
$loader = Loader::get_instance();
$loader->init_settings(); // load the settings
$loader->init_theme(); // set theme
$loader->init_db2();
$m = $loader->load_model('Servers');
// servers
$servers = $m->ServersList();
$i =0;
$servers_list = array();
foreach($servers as $key => $value)
{
$servers_list[$i] = $value['id'];
$i++;
}
if(!isset($_SESSION['server_selected']))
{
$_SESSION['server_selected'] = current($servers_list);
}
// Load server configurations
$gameConfig = $m->Serverdata($_SESSION['server_selected']);
$gameConfig['settings'] = json_decode($gameConfig['settings'], true);
$gameConfig['plus'] = json_decode($gameConfig['plus'], true);
$gameConfig['troop'] = json_decode($gameConfig['troop'], true);
$gameConfig['page'] = json_decode($m->GetSettings("page"), true);
$gameConfig['system'] = json_decode($m->GetSettings("system"), true);
$loader->init_db('xtatar_'.$_SESSION['server_selected']); // connect database
#--------------------------------
# Auto Load the Controller
# init_route set the controller/action/params
# to load the controller
#--------------------------------
$loader->auto_load_controller();
?>
No changes.
@@ -0,0 +1,61 @@
<?php
/**
* alliances class file.
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @copyright Copyright 2013
* @license http://www.xtatar.com
*/
/**
* Dashboard alliances page
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @version $Id$
* @package app.controllers
* @since 1.0
*/
load_core('Admin');
class Alliances_Controller extends AdminController
{
/**
* Constructor Method
* This method defines template layout && view file and load model
*/
public function __construct()
{
parent::__construct();
$this->viewFile = "alliances";
}
/**
* Index Method
*
* @return void
*/
public function index()
{
$this->load_model('Alliance', 'm');
if($_POST)
{
if (is_get('page'))
{
if (get('page') == 'update')
{
$this->m->UpdateAlliance(post('name'), post('name2'), post('creator_player_id'), post('max_player_count'), post('description1'), post('description2'), post('attack_points'), post('defense_points'), post('week_attack_points'), post('week_defense_points'), post('week_dev_points'), post('week_thief_points'));
$this->viewData['sc'] = TRUE;
}
}
if (post('aid'))
{
$this->viewData['a'] = $this->m->GetAllianceDataById(post('aid'));
}
}
}
}
//end file
?>
@@ -0,0 +1,69 @@
<?php
/**
* Block class file.
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @copyright Copyright 2013
* @license http://www.xtatar.com
*/
/**
* Dashboard Block page
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @version $Id$
* @package app.controllers
* @since 1.0
*/
load_core('Admin');
class Block_Controller extends AdminController
{
/**
* Constructor Method
* This method defines template layout && view file and load model
*/
public function __construct()
{
parent::__construct();
$this->viewFile = "block";
}
/**
* Index Method
*
* @return void
*/
public function index()
{
$this->load_model('Block', 'm');
if ($_POST)
{
if (is_post('username') && post('username') != '')
{
$this->viewData['b'] = $this->m->getBlockPlayerPyName(post('username'));
}
elseif(is_post('username'))
{
$this->viewData['e'] = TRUE;
}
if (is_post('name'))
{
$blocked = $this->m->UpdatePlayerPainTime(post('name'), post('time')*3600, post('blocked_reason'));
if ($blocked)
{
$this->viewData['status'] = 'success';
$this->viewData['message'] = 'تم حظر اللاعب '.post('name').' عدد '.post('time').' ساعة';
}
else
{
$this->viewData['status'] = 'error';
$this->viewData['message'] = 'هذا اللعب غير موجود';
}
}
}
}
}
@@ -0,0 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>

<p>Directory access is forbidden.</p>

</body>
</html>
@@ -0,0 +1,60 @@
<?php
/**
* index class file.
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @copyright Copyright 2013
* @license http://www.xtatar.com
*/
/**
* Dashboard index page
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @version $Id$
* @package app.controllers
* @since 1.0
*/
load_core('Admin');
class Index_Controller extends AdminController
{
/**
* Constructor Method
* This method defines template layout && view file and load model
*/
public function __construct()
{
parent::__construct();
$this->viewFile = "home";
}
/**
* Index Method
*
* This method defines template layout && view file and load model
* @return void
*/
public function index()
{
// change server + admin change pass email
if(is_post('change_server'))
{
$new_server_name = post('change_server');
$_SESSION['server_selected'] = $new_server_name;
$this->is_redirect = TRUE;
redirect('index.php');
}
elseif(get('page') == 'logout')
{
$this->Auth->deletesession($_COOKIE['auth_session']);
$this->is_redirect = TRUE;
redirect('login');
}
}
}
//end file
?>
@@ -0,0 +1,68 @@
<?php
/**
* login class file.
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @copyright Copyright 2013
* @license http://www.xtatar.com
*/
/**
* Dashboard login page
*
* @author Abdulrahman Mohamed <abdokamal15@gmail.com>
* @version $Id$
* @package app.controllers
* @since 1.0
*/
load_core('Admin');
class Login_Controller extends AdminController
{
/**
* Constructor Method
* This method defines template layout && view file and load model
*/
public function __construct()
{
parent::__construct();
$this->layoutViewFile = FALSE;
$this->viewFile = "login";
}
/**
* Index Method
*
* @return void
*/
public function index()
{
if(is_post('email'))
{
$email = post("email");
$password = post("password");
$login = $this->Auth->login($email, $password);
if($login)
{
$this->is_redirect = TRUE;
redirect('index.php');
}
else
{
$errormsg = '';
foreach($this->Auth->errormsg as $err)
{
$errormsg.=$err .'<br />';
}
$this->viewData['flash_message'] = array('error', $errormsg);
}
}
}
}
//end file
?>
Oops, something went wrong.

0 comments on commit 73909d6

Please sign in to comment.