public function accountCharts() { $accounts = Account::get(); $AC = new AccountController(); $date = new Carbon('today'); $count = 0; foreach ($accounts as $account) { Auth::loginUsingId($account->fireflyuser_id); // remove cached entry: $key = cacheKey('Account', 'homeOverviewChart', $account->id, $date); Cache::forget($key); $AC->homeOverviewChart($account->id, $date); $count++; Auth::logout(); } return 'Regenerated ' . $count . ' account charts.'; }
public function logout() { $meta = array('title' => 'WhyMusic · Logout', 'description' => 'Logout de WhyMusic.es', 'keywords' => 'php, framework, mvc', 'robots' => 'All'); $login = new ModelLogin(); if ($login->isUserLoggedIn() == true) { AccountController::login(); } else { return ROUTER::show_view('account/logout', array('meta' => $meta)); } }
public function checkGameResult($cards) { $user = new AccountController(); if (isset($cards['stand']) && $cards['playerResult'] <= $cards['dealerResult'] && $cards['dealerResult'] <= 21) { // lose $cards['win'] = 0; $user->updateChips($cards); } elseif (isset($cards['stand']) && $cards['playerResult'] <= 21 && $cards['playerResult'] > $cards['dealerResult']) { // win $cards['win'] = $cards['bet'] * 2; $cards['bankroll'] = $cards['win'] + $cards['bankroll']; $user->updateChips($cards); } elseif (isset($cards['stand']) && $cards['playerResult'] <= 21 && $cards['dealerResult'] > 21) { // win $cards['win'] = $cards['bet'] * 2; $cards['bankroll'] = $cards['win'] + $cards['bankroll']; $user->updateChips($cards); } elseif ($cards['playerResult'] > 21) { // lose $cards['win'] = 0; $user->updateChips($cards); } return $cards; }
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionAjaxUpdate($id) { $model = $this->loadModel($id); $accountController = new AccountController($model->ID_Account); $account = $accountController->loadModel($model->ID_Account); // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); $this->performAjaxValidation($account); if (isset($_POST['Student']) && isset($_POST['Account'])) { $model->attributes = $_POST['Student']; $account->attributes = $_POST['Account']; if ($account->validate() && $account->save()) { if ($model->validate() && $model->save()) { echo '<script type="text/javascript">location.reload()</script>'; } //$this->redirect(array('index','id'=>$model->ID)); } } $this->renderPartial('_form', array('model' => $model, 'account' => $account), false, true); }
<?php //-+---------------------------------------------------------------------------------------------+ // A Simple and Innovative PHP Framework about Foreign Trade E-commerce @2015-07-01 Version 1.0 // 一个简单和创新的PHP框架,为外贸电子商务开发, 始于中国共产党建党日,7月1日,版本1.0 //-+---------------------------------------------------------------------------------------------+ // Update from/更新地址@https://github.com/HollenMok/pandoraf_v1.0 //-+---------------------------------------------------------------------------------------------+ // Display on/项目效果展示地址 @http://www.pandoraf.com //-+---------------------------------------------------------------------------------------------+ // Apache License/开源许可协议 @http://www.apache.org/licenses/LICENSE-2.0 //-+---------------------------------------------------------------------------------------------+ // Document support multi-language, aim to invite people worldwide join this project // 文档目标是支持多语言,让全世界的人有机会了解并参加设计这个项目,目前只支持中文与英语。 //-+---------------------------------------------------------------------------------------------+ require 'controller.php'; $controller = new AccountController(); if ($task) { $controller->{$task}(); } else { $controller->display(); }
<div id="myprofile"> <center> <?php require_once "Account/AccountController.php"; $user = new AccountController($_SESSION["userID"]); $user->LoadUserInfo($db->GetCon()); ?> </center> <?php require_once "views/MyTrail.php"; ?> </div>
/** * Sets up error-handling routines. * * UserFrosting uses Slim's custom error handler to log the error trace in the PHP error log, and then generates a client-side alert (SERVER_ERROR). * It can also take specific actions for certain types of exceptions, such as those thrown from middleware. */ public function setupErrorHandling() { /**** Error Handling Setup ****/ // Custom error-handler: send a generic message to the client, but put the specific error info in the error log. // A Slim application uses its built-in error handler if its debug setting is true; otherwise, it uses the custom error handler. //error_log("Registering error handler"); $this->error(function (\Exception $e) { if ($e instanceof AuthExpiredException) { $controller = new AccountController($this); return $this->logout(true); } if ($e instanceof AccountInvalidException) { $controller = new AccountController($this); return $this->logout(false); } if ($e instanceof AuthCompromisedException) { $controller = new AccountController($this); return $controller->pageAccountCompromised(); } if ($e instanceof \PDOException) { // Log this error error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage()); error_log($e->getTraceAsString()); // In case the error is because someone is trying to reinstall with new db info while still logged in, log them out session_destroy(); $controller = new AccountController($this); return $controller->pageDatabaseError(); } if ($this->alerts && is_object($this->alerts) && $this->translator) { $this->alerts->addMessageTranslated("danger", "SERVER_ERROR"); } error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage()); error_log($e->getTraceAsString()); }); // Also handle fatal errors register_shutdown_function([$this, "fatalHandler"]); }
/** * Sets up error-handling routines. * * UserFrosting uses Slim's custom error handler to log the error trace in the PHP error log, and then generates a client-side alert (SERVER_ERROR). * It can also take specific actions for certain types of exceptions, such as those thrown from middleware. */ public function setupErrorHandling() { /**** Error Handling Setup ****/ // Custom error-handler: send a generic message to the client, but put the specific error info in the error log. // A Slim application uses its built-in error handler if its debug setting is true; otherwise, it uses the custom error handler. //error_log("Registering error handler"); $this->error(function (\Exception $e) { if ($e instanceof AuthExpiredException) { $controller = new AccountController($this); return $this->logout(true); } if ($e instanceof AccountDisabledException) { $this->logout(false); // Create a new session to store alerts $this->startSession(); // Seems to be needed to create a new session as per http://stackoverflow.com/questions/19738422/destroying-old-session-making-new-but-php-still-refers-to-old-session session_regenerate_id(true); $this->setupServices($this->site->default_locale); $this->alerts->addMessageTranslated('danger', 'ACCOUNT_DISABLED'); $this->redirect($this->urlFor('uri_home')); } if ($e instanceof AccountInvalidException) { $this->logout(false); $this->startSession(); session_regenerate_id(true); $this->setupServices($this->site->default_locale); $this->alerts->addMessageTranslated('danger', 'ACCOUNT_INVALID'); $this->redirect($this->urlFor('uri_home')); } if ($e instanceof AuthCompromisedException) { $controller = new AccountController($this); return $controller->pageAccountCompromised(); } if ($e instanceof \PDOException) { // Log this error error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage()); error_log($e->getTraceAsString()); // In case the error is because someone is trying to reinstall with new db info while still logged in, log them out session_destroy(); $controller = new AccountController($this); return $controller->pageDatabaseError(); } if ($this->alerts && is_object($this->alerts) && $this->translator) { $this->alerts->addMessageTranslated("danger", "SERVER_ERROR"); } error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage()); error_log($e->getTraceAsString()); }); // Also handle fatal errors register_shutdown_function([$this, "fatalHandler"]); }
$Controller = new AccountController(); $Controller->logout(); header('location:/home'); /********************************************************* * GAME *********************************************************/ /********************************************************* * GAME *********************************************************/ case 'instructions': $rulesView = new View(); $sMainContentView = $rulesView->fetch('rules.tpl'); break; case 'play': $CardsView = new CardsView(); $userController = new AccountController(); $userId = $_SESSION['user']['id']; if (isset($userId)) { $totalChips = $userController->getTotalChips($userId); $sMainContentView = $CardsView->getMainPlay($totalChips); } else { $sMainContentView = $CardsView->fetch('play.tpl'); } if (isset($_POST)) { $CardsController = new CardsController(); $MessageController = new MessageController(); $CardsView = new CardsView(); if (isset($_POST['deal'])) { $bet = $_POST['bet']; $bankroll = $_POST['bankroll']; $cards = $CardsController->deal($bet, $bankroll);
private function export() { $output = fopen('php://output', 'w') or Utils::fatalError(); header('Content-Type:application/csv'); header('Content-Disposition:attachment;filename=export.csv'); $clients = Client::scope()->get(); AccountController::exportData($output, $clients->toArray()); $contacts = Contact::scope()->get(); AccountController::exportData($output, $contacts->toArray()); $invoices = Invoice::scope()->get(); AccountController::exportData($output, $invoices->toArray()); $invoiceItems = InvoiceItem::scope()->get(); AccountController::exportData($output, $invoiceItems->toArray()); $payments = Payment::scope()->get(); AccountController::exportData($output, $payments->toArray()); $credits = Credit::scope()->get(); AccountController::exportData($output, $credits->toArray()); fclose($output); exit; }
<?php session_start(); include_once '../controller/accountcontroller.php'; include_once '../model/accountmodel.php'; include_once 'accountview.php'; include_once '../../vendor/PHPMailer/PHPMailerAutoload.php'; include_once '../model/db.php'; $accountController = new AccountController(); $accountController->controlInscription();
include_once 'controller/accountcontroller.php'; //session_start(); if (isset($_POST['username'])) { $username = $_POST['username']; } if (isset($_POST['password'])) { $password = $_POST['password']; } /* $accounts = file('storage/account.txt'); foreach($accounts as $account){ $accdata = explode(':',$account); $accuser = $accdata['1']; $accpass = trim($accdata['2']); if($username == $accuser && $password == $accpass){ $_SESSION['id'] = $accdata['0']; $_SESSION['name'] = $username; header("Location: index.php"); } } */ $acccon = new AccountController(); $confirm = $acccon->CheckLogin($username, $password); if ($confirm) { header('Location: index.php'); } else { header('Location: login.php'); }
<?php session_start(); include_once './pageview.php'; include_once '../controller/pagecontroller.php'; include_once '../controller/accountcontroller.php'; include_once '../model/db.php'; include_once '../model/accountmodel.php'; include_once '../view/accountview.php'; $accountController = new AccountController(); $accountController->controlGestion();
<?php /** * Created by PhpStorm. * User: m15026768 * Date: 23/11/2015 * Time: 14:55 */ session_start(); include_once '../model/db.php'; include_once '../controller/accountcontroller.php'; include_once '../model/accountmodel.php'; include_once 'accountview.php'; $accountController = new AccountController(); $accountController->controlConnection();
case 'auth.store': $controller = new AuthenticationController(); $controller->store(); break; case 'auth.attempt': $controller = new AuthenticationController(); $controller->attempt(); break; case 'login': $controller = new AuthenticationController(); $controller->login(); break; case 'account.edit': $controller = new AccountController(); $controller->edit(); case 'upload': $controller = new AccountController(); $controller->upload(); break; case 'logout': $controller = new AuthenticationController(); $controller->logout(); break; case 'comment.create': $controller = new CommentController(); $controller->create(); break; default: echo "404"; break; }
<li role="presentation"<?php if ($_GET['account'] == 'reviewed') { echo 'class="active"'; } ?> ><a href="#">Reviewed</a></li> <li role="presentation"<?php if ($_GET['account'] == 'account') { echo 'class="active"'; } ?> ><a href="#">Account</a></li> </ul> <?php /* PHP View logic to determine view on stories */ if (isset($_GET['account'])) { var_dump(file_exists("init.php")); $controller = new AccountController(); $controller->invoke(); } ?> <?php require_once TEMPLATES_PATH . '/footer.php'; ?>
} } private function checkBox($c) { if (is_null($c)) { return 0; } $i = $c == 'true' ? 1 : 0; return $i; } function updateAvatar() { $dir = '../../images/'; $destination = $dir . $_SESSION[Controller::UID]; echo '<pre>'; if (move_uploaded_file($_FILES['photo']['tmp_name'], $destination)) { echo "File is valid, and was successfully uploaded.\n"; $this->userMapper->updateAvatar(substr($destination, 3)); } else { echo "Possible file upload attack!\n"; } echo 'Here is some more debugging info:'; print_r($_FILES); print "</pre>"; } } if (defined('TEST_SUITE') && TEST_SUITE == __FILE__) { // run test suite here $account = new AccountController(); $account->distribute(); }
<? include(Config::get('VIEWS_PATH') . 'templates/menu.php') ?> <div class="content"> <div class="container clearfix"> <h2>File management</h2> <div class="col-sm-3"> <ul class="nav-left"> <li> <a href="<?php echo Config::get('URL'); ?> /account/upload" <? if (AccountController::checkPage('upload')) echo 'class="active"' ?>>Upload new file</a></li> <li> <a href="<?php echo Config::get('URL'); ?> /account/files" <? if (AccountController::checkPage('files')) echo 'class="active"' ?>>My files</a></li> <!--<li> <a href="<?php /*echo Config::get('URL'); */ ?> /account/bookmarks" <?/* if (AccountController::checkPage('bookmarks')) echo 'class="active"' */?>>Bookmarks</a> </li>--> </ul> </div> <div class="col-sm-9">
/** * @covers a */ function test_updatePassword() { $a = new AccountController(); $result = ""; $user = $a->getUserInfo("jandr018@fiu"); $currentPS = "x12penpw"; $newPass = "******"; if ($user['email'] == "" || $currentPS == "" || $newPass == "") { $result = "You have unset values"; return $this->assertEquals($a->updatePassword($user, $currentPS, $newPass), $result); } $mydatabase = new database(); if ($mydatabase->genPass($currentPS, $user['email']) != $user['password']) { $result = "Incorrect Password"; return $this->assertEquals($a->updatePassword($user, $currentPS, $newPass), $result); } if (!$user['isAdmin']) { $mydatabase->updateStudentPassword_by_id($user['email'], $newPass, $user['id']); } else { if ($user['isAdmin']) { $mydatabase->updateAdminPassword_by_id($user['email'], $newPass, $user['id']); } else { $result = "An error occured"; return $this->assertEquals($a->updatePassword($user, $currentPS, $newPass), $result); } } $result = "pass"; return $this->assertEquals($a->updatePassword($user, $currentPS, $newPass), $result); }
<?php if (isset($_POST['mail'])) { include_once '../controller/accountcontroller.php'; include_once '../model/accountmodel.php'; include_once './accountview.php'; include_once '../../vendor/PHPMailer/PHPMailerAutoload.php'; include_once '../model/db.php'; $accountController = new AccountController(); $accountController->controlRecoverPassword(); }
if ($_GET[KEY_TARGET] == "verifyplease") { AccountController::verifyPlease(); } else { if ($_GET[KEY_TARGET] == "verifydone") { AccountController::verifyDone(); } else { if ($_GET[KEY_TARGET] == "forgetpassword") { AccountController::forgetPassword(); } else { if ($_GET[KEY_TARGET] == "resetpassword") { AccountController::resetPassword(); } else { if ($_GET[KEY_TARGET] == "resetpassworddone") { AccountController::resetPasswordDone(); } else { AccountController::show(); } } } } } } } } } } } } else { if ($_GET[KEY_PATH] == "manager") { include CONTROLLER_PATH . "manager.php"; // path = manager
private function export() { $fecha = Input::get('invoice_date'); $output = fopen('php://output', 'w') or Utils::fatalError(); header('Content-Type:application/csv'); header('Content-Disposition:attachment;filename=export.csv'); $BookSale = DB::table('book_sales')->select('nit_client', 'rz_client', 'number_invoice', 'na_account', 'date_invoice', 'amount', 'ice', 'exempt', 'net_amount', 'iva', 'status', 'cc_invoice')->where('account_id', '=', Auth::user()->account_id)->where('date_invoice', 'LIKE', '%' . $fecha . '%')->get(); AccountController::exportData($output, Utils::toArray($BookSale)); // $clients = Client::scope()->get(); // AccountController::exportData($output, $clients->toArray()); // $contacts = Contact::scope()->get(); // AccountController::exportData($output, $contacts->toArray()); // $invoices = Invoice::scope()->get(); // AccountController::exportData($output, $invoices->toArray()); // $invoiceItems = InvoiceItem::scope()->get(); // AccountController::exportData($output, $invoiceItems->toArray()); // $credits = Credit::scope()->get(); // AccountController::exportData($output, $credits->toArray()); fclose($output); exit; }
<!-- Page Content --> <!-- <section> --> <div id="page-content-wrapper"> <!-- HIE CHUNTS DS VERDAMMTE LOGIN INDE WUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU --> <?php session_start(); include_once 'controller/warenkorbcontroller.php'; include_once 'model/warenkorb.php'; include_once 'controller/antiquitaetcontroller.php'; include_once 'model/antiquitaet.php'; include_once 'controller/accountcontroller.php'; include_once 'model/account.php'; $accocont = new AccountController(); $acco = $accocont->LoadAcc($_SESSION['id']); $cartcont = new WarenkorbController(); $cart = $cartcont->GetByAccount($acco); echo $cart->getPrice(); echo '<table>'; foreach ($cart->getAntiquitaet() as $anti) { $starter = '<tr class="article"><td><img class="smallpreview" width="200" height="200" alt="Artikelbild" src="'; $middle = '" alt="Artikelbild"></td><td>'; $end = '</td></tr>'; foreach ($list as $element) { echo $starter . $anti->getImage() . $middle . $anti->getName() . ': ' . $anti->getDescription() . '<br>' . $anti->getPrice() . $end; } } exit; ?>
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionAjaxUpdate($id) { $model = $this->loadModel($id); $accountController = new AccountController($model->ID_Account); $account = $accountController->loadModel($model->ID_Account); $avatar = $model->Avatar; // Uncomment the following line if AJAX validation is needed $this->performAjaxValidation($model); $this->performAjaxValidation($account); if (isset($_POST['Users']) && isset($_POST['Account'])) { $account->attributes = $_POST['Account']; $model->attributes = $_POST['Users']; $model->Avatar = CUploadedFile::getInstance($model, 'Avatar'); if (!empty($model->Avatar)) { $model->Avatar->saveAs(Yii::getPathOfAlias('webroot') . '/images/avatars/' . $model->Avatar->name); } else { $model->Avatar = $avatar; } if ($account->validate() && $account->save()) { if ($account->validate() && $model->save()) { echo '<script type="text/javascript">location.reload()</script>'; } } //$this->redirect(array('index','id'=>$model->ID)); } $this->renderPartial('_form', array('model' => $model, 'account' => $account), false, true); }
private function exportnew() { $fecha = Input::get('invoice_date'); $dt = Carbon::parse($fecha); $month = $dt->month; $year = $dt->year; $fechaSearch = $month . "/" . $year; $output = fopen('php://output', 'w') or Utils::fatalError(); header('Content-Type:application/csv'); header('Content-Disposition:attachment;filename=Libro_Ventas.csv'); $BookSale = DB::table('book_sales')->select('invoice_date', 'invoice_number', 'number_autho', 'status', 'client_nit', 'client_name', 'amount', 'ice_amount', 'export_amount', 'grav_amount', 'subtotal', 'disc_bonus_amount', 'base_fiscal_debit_amount', 'fiscal_debit_amount', 'control_code')->where('account_id', '=', Auth::user()->account_id)->where('invoice_date', 'LIKE', '%' . $fechaSearch)->orderBy('invoice_date', 'asc')->get(); AccountController::exportBooksale($output, Utils::toArray($BookSale)); fclose($output); exit; }
<?php /* print_r($_POST); exit;*/ /*created by Javier Andrial Date Finished: Oct 2015*/ ini_set('display_errors', 1); error_reporting(~0); require '../Controller/AccountController.php'; $accountController = new AccountController(); $email = ""; $title = ""; $content = ""; $value = "5"; $user = null; session_start(); if (isset($_SESSION['admin login'])) { $email = $_SESSION['admin login']; $user = $accountController->getUserInfo($email); //print_r("im an admin: ".$email); } else { if (isset($_SESSION['login user'])) { $email = $_SESSION['login user']; $user = $accountController->getUserInfo($email); } } //else // print_r("im neither: ".$email);;//print("You're currently not logged in"); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// if (isset($_POST['button_ChangedRecovery'])) {
<?php require_once "src/RenderHTML.php"; require_once "src/controller/AccountController.php"; session_start(); date_default_timezone_set("Europe/Stockholm"); setlocale(LC_ALL, "sv_SE"); $controller = new AccountController(); $body = $controller->HandleAccounts(); $view = new HTMLRenderer(); $view->RenderHTML($body);
$page = $page_controller->renderTemplateWithData('/templates/account/create_account.mustache', null); echo $page; }); $router->respond('GET', '/get-username', function () { require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php'; $page_controller = new PageController(); $page = $page_controller->renderTemplateWithData('/templates/account/get_username.mustache', null); echo $page; }); $router->respond('GET', '/reset-password', function () { $data['show_form'] = isset($_GET['v']) ? 1 : 0; require_once $_SERVER['DOCUMENT_ROOT'] . '/routes/page.controller.php'; $page_controller = new PageController(); $page = $page_controller->renderTemplateWithData('/templates/account/reset_password.mustache', $data); echo $page; }); ////////////////////////////////////////////////////////////// //POST $router->respond('POST', '/new', function () { require_once __DIR__ . '/account.controller.php'; $account_controller = new AccountController(); $user_name = $_POST['data']['username']; $email = $_POST['data']['email']; $password = $_POST['data']['password']; $account_controller->createAccount($user_name, $email, $password); }); $router->respond('POST', '/get-username', function () { }); $router->respond('POST', '/reset-password', function () { }); });