public static function show() { $account = getAccount(); $owner_profile = false; if ($account->getId() == $_SESSION[KEY_SESSION][Account::KEY_ID]) { $owner_profile = true; } include "private.php"; include VIEWS_PATH . "private-nav.php"; include VIEWS_PATH . "account/show.php"; }
public function __construct($srcAccount, $transAccount, $transData) { $_SESSION['transaction'] = array(); $this->transRef = $transData['refNum']; $this->transAccount = getAccount($srcAccount); $this->srcAccount = getAccount($transSource); $this->transType = $transData['type']; $this->transMemo = $transData['memo']; $this->transAmount = $transData['amount']; $this->transDate = date('Y-m-d', strtotime($transData['trans_date'])); $this->transCache = array('transAccount' => $transData['account'], 'transSource' => $transData['trans_source']); }
public function __construct($id = NULL) { if (!is_null($id)) { $account = getAccount($id); $this->id = $account['ID']; $this->name = $account['name']; $this->balance = $account['balance']; $this->due_date = new DateTime($account['due_date']); $this->payment = $account['payment']; $this->billingFrequency = $account['repeating']; $this->interest = $account['interest']; $this->type = $account['type']; $this->interestType = $account['interest_type']; $this->term = $account['term']; $this->creditLimit = $account['credit_limit']; } }
function register() { $uid = getAccount(); $user = $this->getAttributes(); if (empty($user['contact/email'])) { $user['contact/email'] = ""; } if (!empty($user['namePerson/friendly'])) { $username = $user['namePerson/friendly']; } elseif (!empty($user['namePerson'])) { $username = $user['namePerson']; } $ValidReg = $GLOBALS['DATABASE']->getFirstCell("SELECT cle FROM " . USERS_VALID . " WHERE universe = " . $UNI . " AND email = '" . $GLOBALS['DATABASE']->sql_escape($user['contact/email']) . "';"); if (!empty($ValidReg)) { HTTP::redirectTo("index.php?uni=" . $UNI . "&page=reg&action=valid&clef=" . $ValidReg); } $GLOBALS['DATABASE']->query("INSERT INTO " . USERS_AUTH . " SET\n\t\tid = (SELECT id FROM " . USERS . " WHERE email = '" . $GLOBALS['DATABASE']->sql_escape($me['email']) . "' OR email_2 = '" . $GLOBALS['DATABASE']->sql_escape($user['contact/email']) . "'),\n\t\taccount = '" . $uid . "',\n\t\tmode = '" . $GLOBALS['DATABASE']->sql_escape($_REQUEST['openid_identifier']) . "';"); }
function createProject() { $account = getAccount(); $projdue = tryRetrieve($_POST, 'projDue'); $projtime = strtotime($projdue); $duedate = sqlsafe(date("Y-m-d H:i:s", $projtime)); $title = sqlSafe(tryRetrieve($_POST, 'projName')); //$notes = sqlSafe(tryRetrieve($_POST, 'projNotes')); $query = "INSERT INTO projects (account_id, duedate, title) VALUES ({$account}, {$duedate}, {$title})"; if (writeQuery($query)) { $id = getInsertID(); //Now give the project a hash $hash = sqlSafe(hash('adler32', $id)); $query = "UPDATE projects SET hash={$hash} where id='{$id}'"; if (writeQuery($query)) { $_SESSION['project'] = $id; return getProjectInfo(); } } return null; }
$logoPath = getStoreLogo($domain); // Categories $categories = getCategories($storeId); // Products $searchTerm = $_GET["terms"]; $products = searchOnStore($storeId, $searchTerm, 30); $products = array_map("updatePath", $products); // Vat $vat_oux = getStoreById($storeId); $vat = $vat_oux[0]["vat"]; //loged in user $smarty->assign('userPermission', 'guest'); if (isset($_SESSION['storesLogin'][$storeId]['userId'])) { $userInfo = $_SESSION['storesLogin'][$storeId]['userId']; if (isset($userInfo)) { $userInfo = getAccount($userInfo); $userPermission = getAccountPermission($userInfo["id"]); $userPermission = $userPermission["name"]; } $smarty->assign('userInfo', $userInfo); $smarty->assign('userPermission', $userPermission); } /* END -- Get store data */ $storeName = getStoreName($domain); $smarty->assign('title', $storeName . " Search results"); $smarty->assign('logoPath', $logoPath); $smarty->assign('categories', $categories); $smarty->assign('products', $products); $smarty->assign('storeDomain', $domain); $smarty->assign('storeId', $storeId); $smarty->assign('vat', $vat);
// CRM On Premise - IFD // $url = "https://org.domain.com/"; // //Username format could be domain\\username or username in the form of an email // $username = "******"; // $password = "******"; // $crmAuth = new CrmAuth(); // $authHeader = $crmAuth->GetHeaderOnPremise($username, $password, $url); // End CRM On Premise - IFD $userid = WhoAmI($authHeader, $url); if ($userid == null) { return; } //$userid = "ce925ecb-1a43-e511-80da-3863bb361038"; $name = CrmGetUserName($authHeader, $userid, $url); print $name; print getAccount($authHeader, $url); function WhoAmI($authHeader, $url) { $xml = "<s:Body>"; $xml .= "<Execute xmlns=\"http://schemas.microsoft.com/xrm/2011/Contracts/Services\">"; $xml .= "<request i:type=\"c:WhoAmIRequest\" xmlns:b=\"http://schemas.microsoft.com/xrm/2011/Contracts\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:c=\"http://schemas.microsoft.com/crm/2011/Contracts\">"; $xml .= "<b:Parameters xmlns:d=\"http://schemas.datacontract.org/2004/07/System.Collections.Generic\"/>"; $xml .= "<b:RequestId i:nil=\"true\"/>"; $xml .= "<b:RequestName>WhoAmI</b:RequestName>"; $xml .= "</request>"; $xml .= "</Execute>"; $xml .= "</s:Body>"; $executeSoap = new CrmExecuteSoap(); $response = $executeSoap->ExecuteSOAPRequest($authHeader, $xml, $url); $responsedom = new DomDocument(); $responsedom->loadXML($response);
function migrateUserStats() { $denora = new mysqli(DENORA_HOSTNAME, DENORA_USERNAME, DENORA_PASSWORD, DENORA_DATABASE); $anope = new mysqli(ANOPE_HOSTNAME, ANOPE_USERNAME, ANOPE_PASSWORD, ANOPE_DATABASE); $result = $denora->query("SELECT * FROM ustats ORDER BY chan, `type`", MYSQLI_USE_RESULT); while ($row = $result->fetch_assoc()) { $account = getAccount($row['uname']); if (!$account) { continue; } if (!checkAccount($account)) { continue; } $query = sprintf("INSERT INTO anope_chanstats (chan, nick, `type`, letters, words, line, actions, smileys_other, kicks, modes, topics,\r\n\t\ttime0, time1, time2, time3, time4, time5, time6, time7, time8, time9, time10, time11,\r\n\t\ttime12, time13, time14, time15, time16, time17, time18, time19, time20, time21, time22, time23)\r\n\t\tVALUES('%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)\r\n\t\tON DUPLICATE KEY UPDATE letters = letters + %d, words = words + %d, line = line + %d, actions = actions + %d, smileys_other = smileys_other + %d,\r\n\t\tkicks = kicks + %d, modes = modes + %d, topics = topics + %d,\r\n\t\ttime0 = time0 + %d, time1 = time1 + %d, time2 = time2 + %d, time3 = time3 + %d, time4 = time4 + %d, time5 = time5 + %d,\r\n\t\ttime6 = time6 + %d, time7 = time7 + %d, time8 = time8 + %d, time9 = time9 + %d, time10 = time10 + %d, time11 = time11 + %d,\r\n\t\ttime12 = time12 + %d, time13 = time13 + %d, time14 = time14 + %d, time15 = time15 + %d, time16 = time16 + %d, time17 = time17 + %d,\r\n\t\ttime18 = time18 + %d, time19 = time19 + %d, time20 = time20 + %d, time21 = time21 + %d, time22 = time22 + %d, time23 = time23 + %d\r\n\t\t", $row['chan'] == 'global' ? '' : $row['chan'], $account, getAnopeChanstatsType($row['type']), $row['letters'], $row['words'], $row['line'], $row['actions'], $row['smileys'], $row['kicks'], $row['modes'], $row['topics'], $row['time0'], $row['time1'], $row['time2'], $row['time3'], $row['time4'], $row['time5'], $row['time6'], $row['time7'], $row['time8'], $row['time9'], $row['time10'], $row['time11'], $row['time12'], $row['time13'], $row['time14'], $row['time15'], $row['time16'], $row['time17'], $row['time18'], $row['time19'], $row['time20'], $row['time21'], $row['time22'], $row['time23'], $row['letters'], $row['words'], $row['line'], $row['actions'], $row['smileys'], $row['kicks'], $row['modes'], $row['topics'], $row['time0'], $row['time1'], $row['time2'], $row['time3'], $row['time4'], $row['time5'], $row['time6'], $row['time7'], $row['time8'], $row['time9'], $row['time10'], $row['time11'], $row['time12'], $row['time13'], $row['time14'], $row['time15'], $row['time16'], $row['time17'], $row['time18'], $row['time19'], $row['time20'], $row['time21'], $row['time22'], $row['time23']); if (!$anope->query($query)) { die('FAILURE: ' . $query); } } $result->close(); $denora->close(); $anope->close(); }
function postDelete($value) { $app = Slim\Slim::getInstance(); $db = dbConn::getConnection(); $user_details = getAccount($value); $request = $app->request(); $ticket_id = $request->post('ticket_id'); $db_mongo_coll = mongoConn::getConnection(); // remove a ticket with a chosen id $db_mongo_coll->remove(array('_id' => new MongoId($ticket_id)), true); $user_tickets = $db_mongo_coll->find()->sort(array('_id' => -1)); $app->render('../api/resources/view_all_tickets.php', array('user' => $user_details, 'tickets' => $user_tickets)); }
function check_str(&$var) { return !empty($var) && is_string($var) ? $var : ''; } if (isset($_SESSION['login'], $_SESSION['pwd'])) { header('location: ../vues/vue_profile.php'); // alors aller sur la page de profile exit; } // L'authentification est validée. $action = check_str($_POST['action']); $identifier = check_str($_POST['login']); $password = hash('sha512', check_str($_POST['password'])); if ($identifier && $password) { try { $stmt = getAccount($identifier, $password); $result = $stmt->fetch(PDO::FETCH_OBJ); } catch (PDOException $e) { header('location: ../vues/vue_connexion.php?error=db'); exit; } if (!$stmt->rowCount()) { header('location: ../vues/vue_connexion.php?error=noaccount'); exit; } $identifier = $result->identifiant; $password = $result->password; $validation = $result->validation; if ($identifier == check_str($_POST['login']) && $password == hash(sha512, check_str($_POST['password'])) && $validation) { session_start(); $_SESSION['login'] = $_POST['login'];
</div> <div id="listing"> <table class="table table-striped"> <thead> <tr> <th width="15%">Project Name</th> <th width="50%">Notes</th> <th width="10%">Objects</th> <th width="15%">Due</th> <th width="5%">Details</th> <th width="5%">Delete</th> </tr> </thead> <tbody id='projects'> <?php $projects = getProjects(getAccount()); //var_dump($projects); foreach ($projects as $key => $p) { print "<tr>\n"; print "\t<td>" . $p["title"] . "</td>\n"; print "\t<td>" . $p["notes"] . "</td>\n"; if (!isset($p["nObjects"])) { print "\t<td>0</td>\n"; } else { print "\t<td>" . $p["nObjects"] . "</td>\n"; } if ($p['duedate'] != '0000-00-00 00:00:00') { print "\t<td>" . date('M j, Y', strtotime($p["duedate"])) . "</td>\n"; } else { print "\t<td>None</td>\n"; }
$app->get('/getAccount', function () { //Importa el archivo que contiene el método require_once 'Servicios/getAccount.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return; } //Obtiene los parametros del header http $idAccount = $app->request->headers->get('idAccount'); //LLama el método que lee de la base de datos y obtiene la respuesta $respuesta = getAccount($idAccount); //Muestra la respuesta al cliente echo $respuesta; }); //-------------------------------------------------------------------------------------------------- $app->put('/newAccount', function () { //Importa el archivo que contiene el método require_once 'Servicios/newAccount.php'; $app = new \Slim\Slim(); require_once 'Servicios/Auth.php'; $deviceId = $app->request->headers->get('deviceID'); $hash = $app->request->headers->get('hash'); $respuesta = auth($deviceId, $hash); if ($respuesta != "Auth_OK") { echo $respuesta; return;
<?php include_once '../../php/functions.php'; include_once '../../php/ajax.php'; sec_session_start(); $random_salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), true)); $_SESSION['cipher'] = $random_salt; $_SESSION['xcp_id'] = hash('sha512', $random_salt, $_SERVER['HTTP_USER_AGENT']); $account = getAccount($_POST['id']); $_SESSION['account_id'] = $account['ID']; $accountTypes = loadTypes('account_types'); $transTypes = loadTypes('trans_types', $account['type']); $formFields = array(array('transaction-ref' => array('class' => 'xcp-form-input', 'type' => 'text', 'label' => 'Confirmation/Ref #:', 'placeholder' => '', 'title' => ''), 'transaction-date' => array('class' => 'xcp-form-input datepicker', 'type' => 'text', 'label' => 'Transaction Date:', 'placeholder' => 'mm/dd/yyyy', 'desciption' => '')), array('transaction-source' => array('class' => 'chosen-select expense', 'type' => 'select', 'label' => 'Transaction Source:', 'data-placeholder' => 'Select Account', 'title' => '', 'options' => loadSources()), 'transaction-amount' => array('class' => 'xcp-form-input', 'type' => 'text', 'label' => 'Transaction Amount:', 'placeholder' => '', 'title' => '', 'style' => $account['due_date'] < date() ? 'color: red; font-weight:bold' : '', 'value' => number_format($account['payment'], 2))), array('transaction-type' => array('class' => 'chosen-select expense', 'type' => 'select', 'label' => 'Transaction Type:', 'data-placeholder' => 'Select Type', 'title' => '', 'options' => $transTypes), 'transaction-memo' => array('class' => 'xcp-form-input xcp-textarea', 'label' => 'Transaction Memo:', 'title' => '', 'type' => 'textarea'))); ob_start(); ?> <form id="add_transaction"> <section id="" class="page-1 top account-detail"> <h2 class="account-name"><?php echo $account['name']; ?> </h2> <table> <tbody> <tr> <td colspan="3"><h3>Account Status: <span id="account-status"></span></td> </tr> <?php $count = 1; $rowCount = 4; unset($account['user']); foreach ($account as $key => $value) {