/** * \brief Given a folder_pk, try to add a job after checking permissions. * \param $uploadpk - the upload(upload_id) you want to delete * * \return string with the message. */ function TryToDelete($uploadpk) { if (!GetUploadPerm($uploadpk) >= Auth::PERM_WRITE) { $text = _("You dont have permissions to delete the upload"); return DisplayMessage($text); } $rc = $this->Delete($uploadpk); if (!empty($rc)) { $text = _("Deletion Scheduling failed: "); return DisplayMessage($text . $rc); } /* Need to refresh the screen */ $URL = Traceback_uri() . "?mod=showjobs&upload={$uploadpk} "; $LinkText = _("View Jobs"); $text = _("Deletion added to job queue."); $msg = "{$text} <a href={$URL}>{$LinkText}</a>"; return displayMessage($msg); }
/** * \brief Generate the text for this plugin. */ public function Output() { $V = ""; /* If this is a POST, then process the request. */ $uploadpk = GetParm('upload', PARM_INTEGER); if (!empty($uploadpk)) { $rc = $this->Delete($uploadpk); if (empty($rc)) { /* Need to refresh the screen */ $URL = Traceback_uri() . "?mod=showjobs&upload={$uploadpk} "; $LinkText = _("View Jobs"); $text = _("Deletion added to job queue."); $msg = "{$text} <a href={$URL}>{$LinkText}</a>"; $V .= displayMessage($msg); } else { $text = _("Deletion Scheduling failed: "); $V .= DisplayMessage($text . $rc); } } /* Create the AJAX (Active HTTP) javascript for doing the reply and showing the response. */ $V .= ActiveHTTPscript("Uploads"); $V .= "<script language='javascript'>\n"; $V .= "function Uploads_Reply()\n"; $V .= " {\n"; $V .= " if ((Uploads.readyState==4) && (Uploads.status==200))\n"; $V .= " {\n"; /* Remove all options */ //$V.= " document.formy.upload.innerHTML = Uploads.responseText;\n"; $V .= " document.getElementById('uploaddiv').innerHTML = '<BR><select name=\\'upload\\' size=\\'10\\'>' + Uploads.responseText + '</select><P />';\n"; /* Add new options */ $V .= " }\n"; $V .= " }\n"; $V .= "</script>\n"; /* Build HTML form */ $V .= "<form name='formy' method='post'>\n"; // no url = this url $text = _("Select the uploaded file to"); $text1 = _("delete"); $V .= "{$text} <em>{$text1}</em>\n"; $V .= "<ul>\n"; $text = _("This will"); $text1 = _("delete"); $text2 = _("the upload file!"); $V .= "<li>{$text} <em>{$text1}</em> {$text2}\n"; $text = _("Be very careful with your selection since you can delete a lot of work!\n"); $V .= "<li>{$text}"; $text = _("All analysis only associated with the deleted upload file will also be deleted.\n"); $V .= "<li>{$text}"; $text = _("THERE IS NO UNDELETE. When you select something to delete, it will be removed from the database and file repository.\n"); $V .= "<li>{$text}"; $V .= "</ul>\n"; $text = _("Select the uploaded file to delete:"); $V .= "<P>{$text}<P>\n"; $V .= "<ol>\n"; $text = _("Select the folder containing the file to delete: "); $V .= "<li>{$text}"; $V .= "<select name='folder' "; $V .= "onLoad='Uploads_Get((\"" . Traceback_uri() . "?mod=upload_options&folder=-1' "; $V .= "onChange='Uploads_Get(\"" . Traceback_uri() . "?mod=upload_options&folder=\" + this.value)'>\n"; $root_folder_pk = GetUserRootFolder(); $V .= FolderListOption($root_folder_pk, 0); $V .= "</select><P />\n"; $text = _("Select the uploaded project to delete:"); $V .= "<li>{$text}"; $V .= "<div id='uploaddiv'>\n"; $V .= "<BR><select name='upload' size='10'>\n"; $List = FolderListUploads_perm($root_folder_pk, Auth::PERM_WRITE); foreach ($List as $L) { $V .= "<option value='" . $L['upload_pk'] . "'>"; $V .= htmlentities($L['name']); if (!empty($L['upload_desc'])) { $V .= " (" . htmlentities($L['upload_desc']) . ")"; } if (!empty($L['upload_ts'])) { $V .= " :: " . substr($L['upload_ts'], 0, 19); } $V .= "</option>\n"; } $V .= "</select><P />\n"; $V .= "</div>\n"; $V .= "</ol>\n"; $text = _("Delete"); $V .= "<input type='submit' value='{$text}!'>\n"; $V .= "</form>\n"; return $V; }
echo "Er zijn geen algemene roosterwijzigingen voor deze dag."; } echo "<h2>Roosterwijzigingen voor " . $schedule_changes->mySQL->getSchoolSQL()->getStudentName($schedule_changes->student_id) . "</h2><br />"; $specific_changes = $schedule_changes->file_manager->schedule_reader->getSpecificChanges(); if (!empty($specific_changes)) { foreach ($specific_changes as $specific_change) { DisplayMessage($specific_change, "specific"); } } else { echo "Je hebt geen persoonlijke roosterwijzigingen voor deze dag."; } } catch (\Exception $e) { echo $e->getMessage(); } } else { DisplayMessage("Leerlingnummer niet gevonden.", "warning"); } ?> </div> </body> </html> <?php // DisplayMessage("today: " . $today . " tomorrow: " . $tomorrow . " day: " . $day . "<br />", "warning"); if (isset($schedule_changes)) { $schedule_changes->mySQL->closeConnection(); } /** * Gebruikt echo om een bericht als messageItem (css) weer te geven. * * @param string $message Het bericht dat weergegeven moet worden. * @param string $type De manier waarop het bericht weergegeven moet worden -> [general, specific, warning].
define("SSO_BASE_RAND_SEED" . ($x + 5), $seed); } $data = file_get_contents("config.php"); $data .= "<" . "?php\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED5\", " . var_export(SSO_BASE_RAND_SEED5, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED6\", " . var_export(SSO_BASE_RAND_SEED6, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED7\", " . var_export(SSO_BASE_RAND_SEED7, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED8\", " . var_export(SSO_BASE_RAND_SEED8, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED9\", " . var_export(SSO_BASE_RAND_SEED9, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED10\", " . var_export(SSO_BASE_RAND_SEED10, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED11\", " . var_export(SSO_BASE_RAND_SEED11, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED12\", " . var_export(SSO_BASE_RAND_SEED12, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED13\", " . var_export(SSO_BASE_RAND_SEED13, true) . ");\n"; $data .= "\tdefine(\"SSO_BASE_RAND_SEED14\", " . var_export(SSO_BASE_RAND_SEED14, true) . ");\n"; $data .= "\n"; $data .= "\tdefine(\"SSO_PRIMARY_CIPHER\", \"blowfish\");\n"; $data .= "\tdefine(\"SSO_DUAL_ENCRYPT\", true);\n"; $data .= "?" . ">"; if (file_put_contents("config.php", $data) === false) { UpgradeError("Unable to update the server configuration file."); } } // Regenerate namespace keys. SSO_GenerateNamespaceKeys(); $sso_settings[""]["dbversion"] = 3; } // Save the settings so the database version is saved. SSO_SaveSettings(); // Upgrade is done. DisplayMessage("Upgrade completed successfully. You should delete this file off of the server.");