当前位置: 首页>>代码示例>>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;未经允许,请勿转载。