Exemple #1
0
                         existeCliente($decoded->username);
                     } else {
                         if ($decoded->function == 'changePassword') {
                             changePassword($decoded->cliente_id, $decoded->pass_old, $decoded->pass_new);
                         } else {
                             if ($decoded->function == 'getHistoricoPedidos') {
                                 getHistoricoPedidos($decoded->cliente_id);
                             } else {
                                 if ($decoded->function == 'update') {
                                     update($decoded->user);
                                 } else {
                                     if ($decoded->function == 'deleteCliente') {
                                         deleteCliente($decoded->cliente_id);
                                     } else {
                                         if ($decoded->function == 'forgotPassword') {
                                             forgotPassword($decoded->email);
                                         } else {
                                             if ($decoded->function == 'createCupon') {
                                                 createCupon($decoded->cliente_id, $decoded->numero);
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
         $jsonError = ' - Malformed UTF-8 characters, possibly incorrectly encoded';
         break;
     default:
         $jsonError = ' - Unknown error';
         break;
 }
 //not a valid json value found
 if (is_null($decoded)) {
     $response['status'] = array('type' => 'error', 'value' => 'Invalid JSON value found', 'error' => $jsonError);
 } else {
     require 'API.php';
     /* adding API */
     $peopleID;
     $responseArray;
     //update reset password
     $resetPasswordResults = forgotPassword($decoded);
     if ($resetPasswordResults == 1) {
         $responseArray = ["message" => "successfully changed password", "responseType" => $resetPasswordResults, "part" => "2"];
     } else {
         if ($resetPasswordResults == 0) {
             $responseArray = ["message" => "database not responding", "responseType" => $resetPasswordResults, "part" => "2"];
         } else {
             if ($resetPasswordResults == -1 || $resetPasswordResults == -2) {
                 $responseArray = ["message" => "Unable to store changes to Database", "responseType" => $resetPasswordResults, "part" => "2"];
             }
         }
     }
     /* 
       reponse returns the following:
           1   successfully changed password
           0   database not responding
Exemple #3
0
<?php

session_start();
require 'functions.php';
if (isset($_POST['forgot']) && isset($_POST['email']) && isset($_POST['username'])) {
    die(forgotPassword($_POST['email'], $_POST['username']));
}
if (isset($_POST['reset']) && isset($_POST['key']) && isset($_POST['password'])) {
    die(changePassword($_POST['key'], $_POST['password']));
}
if (!isset($_SESSION['loggedin']) && !isset($_SESSION['installer'])) {
    die;
}
/**
 * Holds the functions which the server calls asynchronously.
 */
if (isset($_POST['newHost']) && isset($_SESSION['superadmin'])) {
    die(addNewHost());
}
if (isset($_POST['notificationsRead'])) {
    setNotificationsAsRead();
}
if (isset($_GET['getAllNotifications'])) {
    die(getNotificationsDataTable());
}
if (isset($_POST['removeNotification']) && isset($_POST['notification_id'])) {
    removeNotification();
}
if (isset($_POST['deleteAllNotifications'])) {
    removeAllNotifications();
}
define('IS_CMS_ADMIN', true);
global $APP, $SETTINGS, $TABLE_PREFIX, $CURRENT_USER;
require_once "lib/init.php";
require_once "lib/login_functions.php";
require_once "lib/user_functions.php";
require_once "lib/admin_functions.php";
### Security: Disable external referers and form submissions
$securityErrors = '';
$securityErrors .= security_disablePostWithoutInternalReferer();
$securityErrors .= security_disableExternalReferers();
$securityErrors .= security_warnOnInputWithNoReferer();
alert($securityErrors);
### pre-login actions
$menu = @$_REQUEST['menu'];
if ($menu == "forgotPassword") {
    forgotPassword();
}
if ($menu == "resetPassword") {
    resetPassword();
}
if ($menu == 'license') {
    showInterface('license.php');
}
### Login
doAction('admin_prelogin');
adminLoginMenu();
doAction('admin_postlogin');
### Dispatch actions
if ($menu == 'home' || !$menu) {
    showInterface('home.php');
} else {
Exemple #5
0
         break;
     case "sendemailtoauctioneer":
         $acutionID = $request->auctionID;
         error_log($request->auctioneerID);
         $sql = "SELECT emailAddress FROM user JOIN auction ON userID = auctioneerID WHERE auctionID = {$acutionID}";
         if ($result = $connection->query($sql)) {
             while ($row = $result->fetch_assoc()) {
                 $email = $row['emailAddress'];
             }
             $params = sendemailtoauctioneer($email);
         }
         break;
     case "forgotPassword":
         $email = $request->email;
         error_log($request->email);
         $params = forgotPassword($email);
         break;
 }
 $request = $url . 'api/mail.send.json';
 // Generate curl request
 $session = curl_init($request);
 // Tell curl to use HTTP POST
 curl_setopt($session, CURLOPT_POST, true);
 // Tell curl that this is the body of the POST
 curl_setopt($session, CURLOPT_POSTFIELDS, $params);
 // Tell curl not to return headers, but do return the response
 curl_setopt($session, CURLOPT_HEADER, false);
 curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
 // obtain response
 $response = curl_exec($session);
 curl_close($session);
Exemple #6
0
switch ($action) {
    // Inloggen
    case 'login':
        $params = array($_POST['mail'], $_POST['password']);
        login($params);
        break;
        // Uitloggen
    // Uitloggen
    case 'logout':
        logout();
        break;
        // Wachtwoord vergeten
    // Wachtwoord vergeten
    case 'forgotPassword':
        $params = array($_POST['mail']);
        forgotPassword($params);
        break;
        // Wachtwoord wijzigen
    // Wachtwoord wijzigen
    case 'changePassword':
        $params = array($_POST['oldPassword'], $_POST['newPassword']);
        changePassword($params);
        break;
        // Sportclub toevoegen
    // Sportclub toevoegen
    case 'addSportclub':
        $params = array($_POST['name'], $_POST['address'], $_POST['zipcode'], $_POST['location'], $_POST['phone'], $_POST['mail'], $_POST['contact_person']);
        addSportclub($params);
        break;
        // Bericht versturen
    // Bericht versturen
Exemple #7
0
     $targetDate = $_REQUEST['targetDate'];
     startDiet($currentWeight, $targetWeight, $targetDate);
     break;
 case 'updateWeight':
     $weight = $_REQUEST['weight'];
     updateWeight($weight);
     break;
 case 'statusShare':
     $statusText = $_REQUEST['statusText'];
     $imgType = $_REQUEST['imgType'];
     $imgData = $_REQUEST['imgData'];
     statusShare($statusText, $imgType, $imgData);
     break;
 case 'forgotPassword':
     $email = $_REQUEST['u_email'];
     forgotPassword($email);
     break;
 case 'changePassword':
     $oldPassword = $_REQUEST['oldPassword'];
     $newPassword = $_REQUEST['newPassword'];
     $newPasswordRepeat = $_REQUEST['newPasswordRepeat'];
     changePassword($oldPassword, $newPassword, $newPasswordRepeat);
     break;
 case 'editInfo':
     $firstName = $_REQUEST['firstName'];
     $lastName = $_REQUEST['lastName'];
     $gender = $_REQUEST['gender'];
     $birthday = $_REQUEST['birthday'];
     $country = $_REQUEST['country'];
     $zip = $_REQUEST['zip'];
     editInfo($firstName, $lastName, $gender, $birthday, $country, $zip);