當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HTTPRequest::app方法代碼示例

本文整理匯總了PHP中HTTPRequest::app方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTTPRequest::app方法的具體用法?PHP HTTPRequest::app怎麽用?PHP HTTPRequest::app使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HTTPRequest的用法示例。


在下文中一共展示了HTTPRequest::app方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: executeDelete

 public function executeDelete(HTTPRequest $request)
 {
     $user = $this->_userManager->get($request->app()->httpRequest()->getData('userId'));
     $this->_addressManager->deleteByUserId($user->id());
     $this->_profileManager->deleteByUserId($user->id());
     $this->_profileProManager->deleteByUserId($user->id());
     $listOfAnnounce = $this->_announcementsManager->getByUserId($user->id());
     foreach ($listOfAnnounce as $announce) {
         $this->_announcementPricesManager->deleteByAnnouncementId($annouce->id());
         $this->_announcementUnavailabilitiesManager->deleteByAnnouncementId($annouce->id());
     }
     $this->_announcementsManager->deleteByUserId($user->id());
     $this->_announcementsProManager->deleteByUserId($user->id());
     $this->_announcementReservationsManager->deleteByUserId($user->id());
     $this->_userManager->delete($user->id());
     $userDir = $_SERVER['DOCUMENT_ROOT'] . '/users/' . $user->id();
     if (file_exists($userDir)) {
         rmdir($userDir);
     }
     $messageMail = new Mail();
     $messageMail->sendAccountDeletedByAdmin($user);
     $this->app->httpResponse()->redirect('/admin/users');
 }
開發者ID:Tipkin-Commons,項目名稱:tipkin,代碼行數:23,代碼來源:UsersController.class.php

示例2: executeSend

 public function executeSend(HTTPRequest $request)
 {
     //var_dump($_POST);
     if (!$request->postExists('submit-form')) {
         $this->app->httpResponse()->redirect('/invite');
     } else {
         $this->_userManager = $this->managers->getManagerOf('users');
         //$_POST['useremail']
         $this->_profileManager = $this->managers->getManagerOf('profiles');
         $userId = $this->app->user()->getAttribute('id');
         $this->_user = $this->_userManager->get($userId);
         $this->_profile = $this->_profileManager->getByUserId($userId);
         //$this->user=$this->_userManager->get($_POST['id']);
         $mail = new Mail();
         $invitation = new Invite();
         $invitation->emails_liste = $_POST['emails_liste'];
         if (isset($_POST['sendback'])) {
             $invitation->emails_liste .= "," . $this->_user->getMail();
         }
         $invitation->commentaire = $_POST['commentaire'];
         $user = $this->_userManager->get($request->app()->httpRequest()->getData('userId'));
         $invitation->email_error = $invitation->email_sent = FALSE;
         $mail->sendInvitation($invitation, $this->_user, $this->_profile);
         /*		$mail->to=$_POST['emails_liste'];
         		//$mail->subject="Sujet : vous êtes invité";
         		//$mail->CharSet="UTF-8";
         		
                 $mail->from ='no-reply@tipkin.fr'; // adresse mail du compte qui envoi
               //  $mail->FromName = "L'équipe TIPKIN"; // remplace le nom du destinateur lors de la lecture d'un email
               //  $mail->Sender='no-reply@tipkin.fr';
         		$mail->subject="Vous êtes invité sur TIPKIN";
         	//	$mail->content=htmlentities(htmlspecialchars($_POST['commentaire']));
          			$mail->content="Yoo".$_POST['commentaire'];
         		$liste=preg_split("/[\s,]+/", $_POST['emails_liste']);
         		$error_flag=FALSE;
         		foreach($liste as $email){
         			$mail->to=$email;
         			//$mail->send();
         			if($_REQUEST['error']) {
         				$error_flag=TRUE;
         				$email_error[]=$email;
         			}
         		}
         		
         */
         $message = '';
         if ($invitation->email_error) {
             $result = implode(', ', $invitation->email_error);
             $message = MessageBox::Error("Erreur d'envoi à {$result}");
         }
         if ($invitation->email_sent) {
             $result = implode(', ', $invitation->email_sent);
             $message .= MessageBox::Success("Message envoyé à {$result}");
         }
         $this->page->smarty()->assign('message', $message);
         $this->page->smarty()->assign('emails_liste', $_POST['emails_liste']);
         $this->page->smarty()->assign('commentaire', $_POST['commentaire']);
         /*		$messageMail = new PHPmailer();
         		$messageMail->AddAddress("fr.laugier@gmail.com");
         		$messageMail->From="no-reply@tipkin.fr";
         		$messageMail->Subject="Vous êtes invité sur TIPKIN";
         		$messageMail->Body="COntenu de l'invitation";
         		echo $messageMail->Subject;
                 if(!$messageMail->Send()) {
                     $_REQUEST['error'] = $messageMail->ErrorInfo; // affiche une erreur => pas toujours explicite
                 }
                 $messageMail->SmtpClose();
                 unset($messageMail); // ferme la connexion smtp et désalloue la mémoire...
                 
                 		$this->to = "fr.laugier@gmail.com";
         		$this->subject = 		'Nouveau mot de passe';
                 $this->content = 		'Bonjour ,
         								<br /><br />
         								Vous avez demandé la réinitialisation de votre mot de passe sur Tipkin.
         								<br /><br />
         								Voici vos nouveaux identifiants de connexion :  <br />
         								---------------------------- <br />
         								---------------------------- 
         								<br /><br />
         								A tout de suite sur TIPKIN !
         								<br /><br />Je possède. Tu empruntes. Nous partageons !
         								<br /><br />
         								L\'équipe TIPKIN.';
                 $this->send();
          */
     }
 }
開發者ID:Tipkin-Commons,項目名稱:tipkin,代碼行數:87,代碼來源:InviteController.class.php


注:本文中的HTTPRequest::app方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。