コード例 #1
0
ファイル: globals.php プロジェクト: IASA-GR/appdb-core
 private static function getAlreadyExpiredMessage($notification)
 {
     $qdays = intval(floor(abs($notification["days"])));
     $appindex = array();
     $user = $notification["user"];
     $message = "Dear " . $user["name"] . ",\n";
     if ($qdays > VMCasterNotifications::getMaxPastDays()) {
         $subject = "[EGI APPDB] Virtual appliances expired more than " . VMCasterNotifications::getMaxPastDays() . " days ago";
         $message .= "  the published versions of the following virtual appliances expired more than " . VMCasterNotifications::getMaxPastDays() . " days.\n\n";
     } else {
         $subject = "[EGI APPDB] Virtual appliances expired " . $qdays . " days ago";
         $message .= "  the published versions of the following virtual appliances expired " . $qdays . " days ago.\n\n";
     }
     foreach ($notification["vappliances"] as $vapp) {
         $appindex[] = $vapp;
         $message .= "    [" . count($appindex) . "]. " . $vapp["name"] . " \n";
     }
     $message .= "\n\nBest regards,\n";
     $message .= "AppDB team\n\n";
     $message .= "________________________________________________________________________________________________________\n";
     for ($i = 0; $i < count($appindex); $i += 1) {
         $ap = $appindex[$i];
         $message .= "[" . ($i + 1) . "] https://" . $_SERVER["APPLICATION_UI_HOSTNAME"] . "/store/vappliance/" . $ap["cname"] . "\n";
     }
     $notification["message"] = $message;
     $notification["subject"] = $subject;
     return $notification;
 }