Exemple #1
0
 public function mail()
 {
     //Objekte von Userdata und PHPMailer erstellen
     $data = new Userdata();
     $mail = new PHPMailer();
     //Variablen
     $bestellung = $data->getBestellung();
     $kundennummer = $data->getKundennummer();
     $vorname = $data->getVorname();
     $nachname = $data->getNachname();
     $empfänger = $data->getEmpfänger();
     //function um die Anrede Männlich/Weiblich zu definieren
     $geschlecht = $data->getGeschlecht();
     if ($geschlecht == 'w') {
         $anrede = ' geehrte Frau ';
     } else {
         $anrede = ' geehrter Herr ';
     }
     $mail->SMTPDebug = 2;
     //SMTP Versand definieren
     $mail->isSMTP();
     //Username, Passwort und Port deklarieren
     $mail->Host = 'mail.gmx.net';
     $mail->SMTPAuth = true;
     $mail->Username = '******';
     $mail->Password = '******';
     $mail->SMTPSecure = 'tls';
     $mail->Port = 587;
     //Absender/Empfänger und Reply definieren
     $mail->setFrom('*****@*****.**', 'WIFShop');
     $mail->addAddress($empfänger, $nachname);
     $mail->addReplyTo('*****@*****.**', 'Kundendienst');
     //$mail->addCC('*****@*****.**');
     //$mail->addBCC('*****@*****.**');
     //Betreff und Inhalt
     $mail->Subject = 'Ihre Bestellung Nr: - ' . $bestellung;
     $mail->CharSet = 'utf-8';
     $mail->isHTML(true);
     $mail->Body = '<img src="https://t1.ftcdn.net/jpg/00/46/79/64/500_F_46796494_T2nsU8rxP1NKLBb8a8Egy6TgZiMgf3lz.jpg" />
                   <br>
                   <h1><b>Vielen Dank für Ihre Bestellung bei WIFShop!</b></h1><br>
                   <hr><br>_<br>
                   Sehr' . $anrede . $vorname . ' ' . $nachname . ',<br><br>
                   Wir haben Ihre Bestellung mit der Bestellnummer: ' . $bestellung . ' erhalten.
                   ';
     //Bestätigung über Versand bzw. ErrorInfo
     if (!$mail->send()) {
         echo 'Message could not be sent.';
         echo 'Mailer Error: ' . $mail->ErrorInfo;
     } else {
         $data->closeDB();
         echo 'Message has been sent';
     }
 }
 public function postRegister()
 {
     $data = Input::except('_token');
     $rules = ['email' => 'unique:userdatas,email', 'username' => 'required', 'password' => 'required', 'address' => 'required'];
     $validator = Validator::make($data, $rules);
     if ($validator->fails()) {
         return Redirect::to('users/register')->withInput()->withErrors($validator);
     } else {
         Userdata::create($data);
         return Redirect::to('login')->withSuccess('Your Member!');
     }
 }
 /**
  * Login a user
  * @return 
  * @param $username Object
  * @param $password Object
  */
 function login($username, $password)
 {
     $db =& $this->db;
     Kit::ClassLoader('userdata');
     // Get the SALT for this username
     if (!($userInfo = $db->GetSingleRow(sprintf("SELECT UserID, UserName, UserPassword, UserTypeID, CSPRNG FROM `user` WHERE UserName = '******'", $db->escape_string($username))))) {
         setMessage(__('Username or Password incorrect'));
         return false;
     }
     // User Data Object to check the password
     $userData = new Userdata($db);
     // Is SALT empty
     if ($userInfo['CSPRNG'] == 0) {
         // Check the password using a MD5
         if ($userInfo['UserPassword'] != md5($password)) {
             setMessage(__('Username or Password incorrect'));
             return false;
         }
         // Now that we are validated, generate a new SALT and set the users password.
         $userData->ChangePassword(Kit::ValidateParam($userInfo['UserID'], _INT), null, $password, $password, true);
     } else {
         // Check the users password using the random SALTED password
         if ($userData->validate_password($password, $userInfo['UserPassword']) === false) {
             setMessage(__('Username or Password incorrect'));
             return false;
         }
     }
     // there is a result so we store the userID in the session variable
     $_SESSION['userid'] = Kit::ValidateParam($userInfo['UserID'], _INT);
     $_SESSION['username'] = Kit::ValidateParam($userInfo['UserName'], _USERNAME);
     $_SESSION['usertype'] = Kit::ValidateParam($userInfo['UserTypeID'], _INT);
     // Set the User Object
     $this->usertypeid = $_SESSION['usertype'];
     $this->userid = $_SESSION['userid'];
     // update the db
     // write out to the db that the logged in user has accessed the page
     $SQL = sprintf("UPDATE user SET lastaccessed = '" . date("Y-m-d H:i:s") . "', loggedin = 1 WHERE userid = %d", $_SESSION['userid']);
     $db->query($SQL) or trigger_error(__('Can not write last accessed info.'), E_USER_ERROR);
     // Switch Session ID's
     global $session;
     $session->setIsExpired(0);
     $session->RegenerateSessionID(session_id());
     return true;
 }
Exemple #4
0
 public function copyUserRestrictions($fromUserId)
 {
     $mUD = new mUserdata();
     $mUD->addAssocV3("UserID", "=", $fromUserId);
     $mUD->lCV3();
     $cUD = new mUserdata();
     $cUD->addAssocV3("UserID", "=", $this->ID);
     $cUD->addAssocV3("typ", "=", "uRest", "AND", "1");
     $cUD->addAssocV3("typ", "=", "relab", "OR", "1");
     $cUD->addAssocV3("typ", "=", "hideF", "OR", "1");
     $cUD->addAssocV3("typ", "=", "pSpec", "OR", "1");
     $cUD->addAssocV3("typ", "=", "pHide", "OR", "1");
     $cUD->lCV3();
     if ($cUD->getNextEntry() != null) {
         die("Target userdata not empty!");
     }
     while ($t = $mUD->getNextEntry()) {
         $A = $t->getA();
         $A->UserID = $this->ID;
         $nU = new Userdata(-1);
         $nU->setA($A);
         $nU->newMe();
     }
 }
 public function updateOrder($order)
 {
     $ex = explode(";", $order);
     foreach ($ex as $k => $v) {
         $U = new Userdata($v);
         $exW = explode(";", $U->A("wert"));
         $exW[0] = ($k < 100 ? "0" : "") . ($k < 10 ? "0" : "") . $k;
         $U->changeA("wert", implode(";", $exW));
         $U->saveMe(true, false);
     }
 }
Exemple #6
0
    public function mail()
    {
        //Objekte von Userdata und PHPMailer erstellen
        $data = new Userdata();
        $mail = new PHPMailer();
        //Variablen
        $bestellung = $data->getBestellung();
        $kundennummer = $data->getKundennummer();
        $vorname = $data->getVorname();
        $nachname = $data->getNachname();
        $empfänger = $data->getEmpfänger();
        //function um die Anrede Männlich/Weiblich zu definieren
        $geschlecht = $data->getGeschlecht();
        if ($geschlecht == 'w') {
            $anrede = ' geehrte Frau ';
        } else {
            $anrede = ' geehrter Herr ';
        }
        $mail->SMTPDebug = 2;
        //SMTP Versand definieren
        $mail->isSMTP();
        //Username, Passwort und Port deklarieren
        $mail->Host = 'mail.gmx.net';
        $mail->SMTPAuth = true;
        $mail->Username = '******';
        $mail->Password = '******';
        $mail->SMTPSecure = 'tls';
        $mail->Port = 587;
        //Absender/Empfänger und Reply definieren
        $mail->setFrom('*****@*****.**', 'WIFShop');
        $mail->addAddress($empfänger, $nachname);
        $mail->addReplyTo('*****@*****.**', 'Kundendienst');
        //$mail->addCC('*****@*****.**');
        //$mail->addBCC('*****@*****.**');
        //Betreff und Inhalt
        $mail->Subject = 'Ihre Bestellung Nr: - ' . $bestellung;
        $mail->CharSet = 'utf-8';
        $mail->isHTML(true);
        $mail->Body = '<img src="https://t1.ftcdn.net/jpg/00/46/79/64/500_F_46796494_T2nsU8rxP1NKLBb8a8Egy6TgZiMgf3lz.jpg" />
                      <br>
                      <h1><b>Vielen Dank für Ihre Bestellung bei WIFShop!</b></h1><br>
                      <hr><br><br>
                      Sehr' . $anrede . $vorname . ' ' . $nachname . ',<br><br>
                      Wir haben Ihre Bestellung mit der Bestellnummer: ' . $bestellung . ' erhalten.
                      <hr>
                      <br>
                      <fieldset>
                      Möchten Sie Ihre Bestellung ändern, besuchen Sie bitte unsere Hilfeseite, wo Sie Informationen und Hilfevideos dazu finden.

                      Wir freuen uns auf Ihren nächsten Besuch!<br>
                      FashionFactory<br>
                      http://wfprj-wf5.informatik.hs-ulm.de/36/RenatoSicherheitskopie/wfprjTest2/public/index.php
                      </fieldset>
                      <br>
                      <fieldset>
                      <font size ="-10">Artikel mit dem Hinweis "Versand durch FashionFactory" werden bei einem Drittanbieter gekauft, aber von einem unserer Logistikzentren an Sie verschickt. 

                       Wir weisen darauf hin, dass Verkäufer möglicherweise zusätzliche Informationen, wie beispielsweise die USt-Identifikationsnummer anfragen werden, um korrekte Rechnungen ausstellen zu können.

                       Bitte beachten Sie: Diese E-Mail dient lediglich der Bestätigung des Einganges Ihrer Bestellung und stellt noch keine Annahme Ihres Angebotes auf Abschluss eines Kaufvertrages dar. Ihr Kaufvertrag für einen Artikel kommt zu Stande, wenn wir Ihre Bestellung annehmen, indem wir Ihnen eine E-Mail mit der Benachrichtigung zusenden, dass der Artikel an Sie abgeschickt wurde.

                       Dies ist eine automatisch versendete Nachricht. Bitte antworten Sie nicht auf dieses Schreiben, da die Adresse nur zur Versendung von E-Mails eingerichtet ist. </font>
                      </fieldset>';
        //Sprint 4 Ridvan Zeile 77-89
        //Bestätigung über Versand bzw. ErrorInfo
        if (!$mail->send()) {
            echo 'Message could not be sent.';
            echo 'Mailer Error: ' . $mail->ErrorInfo;
        } else {
            $data->closeDB();
            echo 'Message has been sent';
        }
    }
Exemple #7
0
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
require_once 'http_request.php';
require_once 'Userdata.php';
$http_request = new http_request();
$request = json_decode($http_request->body, true);
$userdata = new Userdata($request);
if ($userdata->getUserId() === false) {
    header("HTTP/1.1 403 Forbidden");
    header("Content-Type: text/html");
    $data = array('error' => 'Invalid credentials');
    echo json_encode($data);
    exit;
}
$ok = false;
if (strlen($request['cmd']) && strlen($request['username'])) {
    if (strcmp($request['cmd'], 'savePreferences') == 0) {
        if (!$userdata->userExists($request['username'])) {
            header("HTTP/1.1 403 Forbidden");
            header("Content-Type: text/html");
            print "User does not exist\r\n";
            exit;
"> <?php 
        echo $item->name;
        ?>
 </option>
		<?php 
    }
    ?>
			</select>

    </div>
    <div class="col-lg-3">
    <label for="inputPassword1" class="control-label">Mesero</label>
	<select class="form-control" id="mesero" name="mesero_id" required>
			<option value=""> -- SELECCIONE MESERO-- </option>
		<?php 
    foreach (Userdata::getAllMeseros() as $mesero) {
        ?>
			<option value="<?php 
        echo $mesero->id;
        ?>
"> <?php 
        echo $mesero->name . " " . $mesero->lastname;
        ?>
 </option>
		<?php 
    }
    ?>
			</select>
    </div>
    <div class="col-lg-3">
    <label for="inputEmail1" class="control-label">Finalizar</label><br>
Exemple #9
0
 public function addUserData(Userdata $userData)
 {
     $userData->setRegister($this);
     // synchronously updating inverse side
 }
 public function setUserdata($name, $wert, $typ = "", $UserID = 0, $echoSaved = false)
 {
     if ($UserID != 0 and $_SESSION["S"]->isUserAdmin() == "0") {
         echo "Only an admin-user can change Userdata of other users!";
         exit;
     }
     if ($typ == "uRest" and $_SESSION["S"]->isUserAdmin() == "0") {
         echo "Only an admin-user can change restrictions!";
         exit;
     }
     if ($UserID == 0) {
         $UserID = $_SESSION["S"]->getCurrentUser()->getID();
     }
     $UD = $this->getUserdata($name, $UserID);
     if ($UD == null) {
         $nUD = new Userdata(-1);
         $nUDA = $nUD->newAttributes();
         $nUDA->UserID = $UserID;
         $nUDA->name = $name;
         $nUDA->wert = $wert;
         $nUDA->typ = $typ;
         $nUD->setA($nUDA);
         $nUD->newMe();
         $this->collector[] = $nUD;
     } else {
         $UD->saveNewValue($wert);
     }
     if ($echoSaved) {
         Red::messageSaved();
     }
 }
Exemple #11
0
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
require_once 'http_request.php';
require_once 'Userdata.php';
$http_request = new http_request();
$request = json_decode($http_request->body, true);
$userdata = new Userdata($request);
$ok = false;
if (strcmp($request['cmd'], 'lostpassword') == 0) {
    if (!$userdata->lostPasswordForUserWithEmail($request['email'], $request['url'], $request['subject'], $request['body'])) {
        header("HTTP/1.1 200 OK");
        header("Content-Type: text/html");
        $data = array('error' => 12);
        echo json_encode($data);
        $ok = true;
    } else {
        header("HTTP/1.1 200 OK");
        header("Content-Type: text/html");
        $data = array('success' => 1);
        echo json_encode($data);
        $ok = true;
    }
 public function saveMe($checkUserData = true, $output = false)
 {
     unset($this->A->server);
     unset($this->A->passwort);
     unset($this->A->optionen);
     unset($this->A->benutzername);
     parent::saveMe($checkUserData, $output);
 }
 public function userList($sortOrder = array('username'), $filterBy = array())
 {
     // Normal users can only see themselves
     if ($this->usertypeid == 3) {
         $filterBy['userId'] = $this->userid;
     } else {
         if ($this->usertypeid == 2) {
             $groups = $this->GetUserGroups($this->userid, true);
             $filterBy['groupIds'] = isset($filterBy['groupIds']) ? array_merge($filterBy['groupIds'], $groups) : $groups;
         }
     }
     try {
         $user = Userdata::entries($sortOrder, $filterBy);
         $parsedUser = array();
         foreach ($user as $row) {
             $userItem = array();
             // Validate each param and add it to the array.
             $userItem['userid'] = $row->userId;
             $userItem['username'] = $row->userName;
             $userItem['usertypeid'] = $row->userTypeId;
             $userItem['homepage'] = $row->homePage;
             $userItem['email'] = $row->email;
             $userItem['newuserwizard'] = $row->newUserWizard;
             $userItem['lastaccessed'] = $row->lastAccessed;
             $userItem['loggedin'] = $row->loggedIn;
             $userItem['retired'] = $row->retired;
             $userItem['object'] = $row;
             // Add to the collection
             $parsedUser[] = $userItem;
         }
         return $parsedUser;
     } catch (Exception $e) {
         Debug::LogEntry('error', $e->getMessage(), get_class(), __FUNCTION__);
         return false;
     }
 }
Exemple #14
0
         $_SESSION['auth'] = false;
         reportError("0", __("Password incorrect. Please try again."));
     } else {
         $_SESSION['auth'] = true;
         $_SESSION['db'] = $db;
     }
 } else {
     // New auth
     Kit::ClassLoader('userdata');
     // Get the SALT for this username
     if (!($userInfo = $db->GetSingleRow(sprintf("SELECT UserID, UserName, UserPassword, UserTypeID, CSPRNG FROM `user` WHERE UserName = '******'", $db->escape_string($username))))) {
         $_SESSION['auth'] = false;
         reportError("0", __("Password incorrect. Please try again."));
     }
     // User Data Object to check the password
     $userData = new Userdata($db);
     // Is SALT empty
     if ($userInfo['CSPRNG'] == 0) {
         // Check the password using a MD5
         if ($userInfo['UserPassword'] != md5($password)) {
             $_SESSION['auth'] = false;
             reportError("0", __("Password incorrect. Please try again."));
         }
         // Now that we are validated, generate a new SALT and set the users password.
         $userData->ChangePassword(Kit::ValidateParam($userInfo['UserID'], _INT), null, $password, $password, true);
     } else {
         // Check the users password using the random SALTED password
         if ($userData->validate_password($password, $userInfo['UserPassword']) === false) {
             $_SESSION['auth'] = false;
             reportError("0", __("Password incorrect. Please try again."));
         }
Exemple #15
0
 /**
  * Set a users password
  */
 public function SetPassword()
 {
     // Check the token
     if (!Kit::CheckToken()) {
         trigger_error('Token does not match', E_USER_ERROR);
     }
     $db =& $this->db;
     $response = new ResponseManager();
     $newPassword = Kit::GetParam('newPassword', _POST, _STRING);
     $retypeNewPassword = Kit::GetParam('retypeNewPassword', _POST, _STRING);
     $userId = Kit::GetParam('UserId', _POST, _INT);
     // Check we are an admin
     if ($this->user->usertypeid != 1) {
         trigger_error(__('Trying to change the password for another user denied'), E_USER_ERROR);
     }
     Kit::ClassLoader('userdata');
     $userData = new Userdata($db);
     if (!$userData->ChangePassword($userId, null, $newPassword, $retypeNewPassword, true)) {
         trigger_error($userData->GetErrorMessage(), E_USER_ERROR);
     }
     $response->SetFormSubmitResponse(__('Password Changed'));
     $response->Respond();
 }