summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/model/settings.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/app/model/settings.php b/app/model/settings.php
index 3262dec..a3afa0f 100644
--- a/app/model/settings.php
+++ b/app/model/settings.php
@@ -13,6 +13,7 @@
*/
require_once "class/form.class.php";
+require_once "class/settings.class.php";
require_once "class/user.class.php";
/*
@@ -99,4 +100,43 @@ if (isAction("settings-user"))
$user->saveObj();
}
+/*
+ * Action: settings-admin - Modify global settings
+ */
+if (isAction("settings-admin"))
+{
+ $form = new form();
+ $form->flag("sslOnly");
+ $form->flag("allowPublicSignup");
+ $form->text("smtpEmailAddress", false);
+ $form->text("smtpFrom", false);
+ $form->text("smtpServer", false);
+ $form->numeric("smtpPort", 0, 65535);
+ $form->enum("smtpSecurity", array("", "ssl", "tls"));
+ $form->text("smtpUname", false);
+ $form->text("smtpPasswd", false);
+
+ if (!$form->populate(input()))
+ return;
+
+ /* permissions */
+ if (!($cu = user::getCurrent()) || $cu->admin == 0)
+ {
+ logError(ERROR, "You do not have permission to modify global settings");
+ return;
+ }
+
+ settings::sslOnly($form->sslOnly);
+ settings::allowPublicSignup($form->allowPublicSignup);
+ settings::smtpEmailAddress($form->smtpEmailAddress);
+ settings::smtpFrom($form->smtpFrom);
+ settings::smtpServer($form->smtpServer);
+ settings::smtpPort($form->smtpPort);
+ settings::smtpSecurity($form->smtpSecurity);
+ settings::smtpUname($form->smtpUname);
+
+ if ($form->smtpPasswd != "")
+ settings::smtpPasswd($form->smtpPasswd);
+}
+
?>