Beispiel #1
0
/**
 * Simple wrapper for Limonade redirect_to () function
 *
 * @param string  $url
 * @param boolean $secured  Whether to use https or not
 * @return string
 */
function fz_redirect_to($url, $secured = false)
{
    return redirect_to(fz_url_for($url, $secured));
}
Beispiel #2
0
 /**
  * Notify the user by email that its file has been uploaded
  *
  * @param App_Model_File $file
  */
 private function sendFileUploadedMail(App_Model_File $file)
 {
     if (!$file->notify_uploader) {
         return;
     }
     $user = $this->getUser();
     $subject = __r('[FileZ] "%file_name%" uploaded successfully', array('file_name' => $file->file_name));
     $msg = __r('email_upload_success (%file_name%, %file_url%, %filez_url%, %available_from%, %available_until%)', array('file_name' => $file->file_name, 'available_from' => $file->getAvailableFrom()->toString(Zend_Date::DATE_LONG), 'available_until' => $file->getAvailableUntil()->toString(Zend_Date::DATE_LONG), 'file_url' => $file->getDownloadUrl(), 'filez_url' => fz_url_for('/', fz_config_get('app', 'https') == 'always')));
     $mail = $this->createMail();
     $mail->setBodyText($msg);
     $mail->setSubject($subject);
     $mail->addTo($user->email, $user->firstname . ' ' . $user->lastname);
     try {
         $mail->send();
     } catch (Exception $e) {
         fz_log('Can\'t send email "File Uploaded" : ' . $e, FZ_LOG_ERROR);
     }
 }