Esempio n. 1
0
File: ajax.php Progetto: RickdeM/wms
 /**
  * Ajax Constructor
  *
  * @version 1
  * @author Rick de Man <*****@*****.**>
  *
  */
 protected function Ajax__Construct()
 {
     $this->User__Construct();
     // Which Function should be called
     switch (GetPost('Action')) {
         case 'Login':
             $this->Ajax_Login();
             break;
         case 'Logout':
             $this->Ajax_Logout();
             break;
         case 'Component':
             $this->Ajax_Component();
             break;
         default:
             // Bad Request
             $this->Ajax__Result(Ajax::BADREQUEST);
             break;
     }
 }
Esempio n. 2
0
 /**
  * The method for AJAX request handling
  *
  * @version 1
  * @author Rick de Man <*****@*****.**>
  *        
  */
 public function Ajax()
 {
     // User must be signed in
     if ($this->User['loggedIn'] !== true) {
         return Ajax::GUESTNOTALLOWED;
     }
     // 'Starred' Del/Set
     if (in_array(GetPOST('AjaxAction'), array('StarredDel', 'StarredSet'))) {
         // Validating POST DATA
         $Validate = ValidatePOST(array('ID'));
         // Look for missing Parameter
         if ($Validate !== True) {
             return array(Ajax::PARAMETERNOTFOUND, array('%s' => HtmlHide('POST:' . $Validate)));
         }
         // ID must be an array
         if (!is_array(GetPOST('ID'))) {
             return Ajax::INVALIDPARAMETERS;
         }
         // Query Setup
         $Query = 'UPDATE `%component_messages_inbox` SET starred = ? WHERE ID = ? AND reciever = ?';
         $Comment = 'Loading messages data';
         // Prepare the SQL statement
         $this->SQL->Query_Prepare($Query, $Comment);
         // Loop each for ID's
         foreach (GetPOST('ID') as $ID) {
             $Values = array(GetPOST('AjaxAction') == 'StarredDel' ? 0 : 1, $ID, $this->User['ID']);
             // Execute the Current Query with Parameters
             $this->SQL->Query_Execute($Values, false);
         }
         // Free the SQL
         $this->SQL->Query_Next();
         return Ajax::SUCCESS;
     }
     // 'starred' Toggle
     if (GetPOST('AjaxAction') == 'StarredToggle') {
         // Validating POST DATA
         $Validate = ValidatePOST(array('ID'));
         // Look for missing Parameter
         if ($Validate !== True) {
             return array(Ajax::PARAMETERNOTFOUND, array('%s' => HtmlHide('POST:' . $Validate)));
         }
         if (GetPOST('ID') == '') {
             return Ajax::INVALIDPARAMETERS;
         }
         // Query Setup
         $Query = 'UPDATE `%component_messages_inbox` SET starred = IF( starred = 1, 0, 1) WHERE ID = ? AND reciever = ?';
         $Comment = 'Toggle message Starred Flag';
         $Values = array(intval(GetPost('ID')), $this->User['ID']);
         // Prepare the SQL statement
         $this->SQL->Query_Prepare($Query, $Comment);
         // Execute the Current Query with Parameters
         $Result = $this->SQL->Query_Execute($Values, false, true);
         return Ajax::SUCCESS;
     }
     if (GetPOST('AjaxAction') == 'UnreadSet') {
         // Validating POST DATA
         $Validate = ValidatePOST(array('ID'));
         // Look for missing Parameter
         if ($Validate !== True) {
             return array(Ajax::PARAMETERNOTFOUND, array('%s' => HtmlHide('POST:' . $Validate)));
         }
         if (is_array(GetPOST('ID'))) {
             // Storage for messages
             $Messages = array();
             // Query Setup
             $Query = 'SELECT * FROM `%component_messages_inbox` WHERE ID = ? AND unread = 0';
             $Comment = 'Loading messages data';
             // Prepare the SQL statement
             $this->SQL->Query_Prepare($Query, $Comment);
             foreach (GetPOST('ID') as $ID) {
                 $Values = array($ID);
                 // Execute the Current Query with Parameters
                 $Message = $this->SQL->Query_Execute($Values, false);
                 if ($Message['reciever'] == $this->User['ID']) {
                     $Messages[] = $Message['ID'];
                 }
             }
             $this->SQL->Query_Next();
             // Query Setup
             $Query = 'UPDATE `%component_messages_inbox` SET unread = ? WHERE ID = ? ';
             $Comment = 'Loading messages data';
             // Prepare the SQL statement
             $this->SQL->Query_Prepare($Query, $Comment);
             foreach ($Messages as $ID) {
                 $Values = array(1, $ID);
                 // Execute the Current Query with Parameters
                 $this->SQL->Query_Execute($Values, false);
             }
             $this->SQL->Query_Next();
             return Ajax::SUCCESS;
         }
     }
     return Ajax::METHODNOTIMPLEMENTED;
 }
Esempio n. 3
0
        Installation::CreateConfigFile($configData);
        require "config.php";
        //Installation::CreateDatabase();
        $utc = new DateTimeZone('UTC');
        $dt = new DateTime('now', $utc);
        require "install/templates/community.php";
        $db->DestroyConnection();
        break;
    case 5:
        require "core/classes/main.class.php";
        require "install/install.class.php";
        $configData = array('forum_name' => GetPost('community_name'), 'forum_base_url' => GetPost('community_url'), 'forum_timezone' => GetPost('community_timezone'));
        Installation::EditConfigFile($configData);
        require "install/templates/admincreation.php";
        break;
    case 6:
        require "core/classes/main.class.php";
        require "install/install.class.php";
        require "config.php";
        $adminData = array('name' => $db->SafeString(GetPost('admin_username')), 'email' => $db->SafeString(GetPost('admin_email')), 'password' => $db->SafeString(GetPost('admin_password')), 'password2' => $db->SafeString(GetPost('admin_password2')));
        $creation = Installation::CreateAdminAccount($adminData);
        require "install/templates/status.php";
        $db->DestroyConnection();
        break;
    case 7:
        require "install/templates/finished.php";
        break;
    default:
        require "install/templates/home.php";
        break;
}
Esempio n. 4
0
require_once 'app_code/Utilities.php';
require_once 'app_code/Fleet.php';
require_once 'app_code/Alliance.php';
require_once 'app_code/DataManager.php';
$brow = EveBowserFactory::Get();
if (!($brow->IsIGB() && $brow->IsTrusted())) {
    RedirectResponse('links.php');
}
if (isset($_POST['fleetLink']) && isset($_POST['name'])) {
    $matches;
    if (preg_match('/gang:(?<id>\\d+)/', GetPost('fleetLink'), $matches)) {
        $a = Alliance::EnsureAlliance($brow->AllianceId(), $brow->AllianceName());
        $f = new Fleet();
        $f->Id = $matches['id'];
        $f->AllianceId = $a->Id;
        $f->Name = GetPost('name');
        $f->Added = time();
        if ($f->Validate()) {
            $f->Save();
            // this seems like a good place to delete old fleets
            Fleet::DeleteOldFleets();
            DataManager::GetInstance()->CloseConnection();
            RedirectResponse('links.php');
        }
    }
}
?>

<html>

<head>
Esempio n. 5
0
<?php

if (!$pageid) {
    $language['login'] = $template->LoadLanguageFile('login');
    SetPageTitle($forum['name'] . ' | ' . $language['login']['page_title']);
} else {
    if ($pageid == 'auth') {
        require "core/classes/auth.class.php";
        $language['login'] = $template->LoadLanguageFile('login');
        SetPageTitle($forum['name'] . ' | ' . $language['login']['page_title']);
        $account = Auth::AuthenticateUser(GetPost('login_username'), GetPost('login_password'));
        if ($account) {
            if (!GetPost('login_remember')) {
                HBBSetCookie('hbb', $account, time() + 3600);
            } else {
                HBBSetCookie('hbb', $account, time() + 62208000);
            }
            Redirect('index.php');
        }
    }
}
Esempio n. 6
0
    <link rel='stylesheet prefetch' href='http://code.jquery.com/ui/jquery-ui-git.css'>
        <link rel="stylesheet" href="css/style.css">
  </head>
  <body>
    <div class="container login">
  <div class="linha">
    <div class="coluna-12 clogin">
    <form action="" method="post">
     <h2>Login</h2>
     <?php 
ValidateLogin();
?>
      <label>Usuario:</label>
      <input type="text" name="username" value="<?php 
GetPost('username');
?>
"/>
       <label>Senha:</label>
      <input type="password" name="password"  value="<?php 
GetPost('password');
?>
"/>
      <button type="submit" name="send" value="Cadastrar">Entrar</button>
    </form>
    </div>
    </div>
  </div>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
  </body>
</html>
Esempio n. 7
0
         }
     }
     break;
 case 'register':
     if (!$pageid) {
         $language['registration'] = $template->LoadLanguageFile('register');
         SetPageTitle($forum['name'] . ' | ' . $language['registration']['page_title']);
         $agreement = Main::SanitazeInputForJs(read_File('agreement.hbb'));
         $template->LoadTemplateFile('register', 'auth', ['language' => $language['registration'], 'agreement' => $agreement]);
     } else {
         if ($pageid == 'continue') {
             require "core/classes/register.class.php";
             $agreement = Main::SanitazeInputForJs(read_File('agreement.hbb'));
             $language['registration'] = $template->LoadLanguageFile('register');
             SetPageTitle($forum['name'] . ' | ' . $language['registration']['page_title']);
             $registerState = Registration::RegisterUser(['username' => GetPost('register_username'), 'email' => GetPost('register_email'), 'password' => GetPost('register_password'), 'password2' => GetPost('register_password2')]);
             $template->LoadTemplateFile('registerContinue', 'auth', ['language' => $language['registration'], 'regStatus' => $registerState, 'agreement' => $agreement]);
         }
     }
     break;
 default:
     SetPageTitle($forum['name']);
     require "core/classes/forum.class.php";
     $forum = new Forum();
     $language['boards'] = $template->LoadLanguageFile('boards');
     $categories = $forum->LoadCategories();
     $cShfl = explode("|", GetCookie('cshfl'));
     foreach ($cShfl as $catId) {
         if (isset($catId)) {
             $catShuffle[$catId] = true;
         }
Esempio n. 8
0
<?php

/*
  The user card handler
  It is called via jquery onclick event
*/
require "../functions.php";
if (GetPost('uid')) {
    require "../../config.php";
    require "../../external/libs/Smarty.class.php";
    require "../classes/template.class.php";
    require "../classes/user.class.php";
    $smarty = new Smarty();
    $template = new Template('../../' . $settings['tempPath'], '../../' . $settings['langPath'], $smarty);
    $user = new User(NULL, GetPost('uid'));
    $template->theme = GetPost('theme');
    $template->language = GetPost('language');
    $language['usercard'] = $template->LoadLanguageFile('usercard');
    $template->LoadTemplateFile('usercard', NULL, ['language' => $language['usercard'], 'user' => $user->loadUserCard(), 'userId' => GetPost('uid')]);
    $db->DestroyConnection();
}
Esempio n. 9
0
echo GetPost('mail');
?>
" />
      <label>Usuário:</label>
      <input type="text" name="username" value="<?php 
echo GetPost('username');
?>
" />
      <label>Senha:</label>
      <input type="password" name="password" value="<?php 
echo GetPost('password');
?>
" />
      <label>Confirma Senha:</label>
      <input type="password" name="confirma" value="<?php 
echo GetPost('confirma');
?>
" />
      <button type="submit" name="send" value="Cadastrar">Registrar</button>
            <a href="<?php 
echo URL_BASE;
?>
" title="cadastrar-se">Login</a>
    </form>
    </div>
    </div>
  </div>
</div>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>