예제 #1
0
파일: Database.php 프로젝트: Zyko0/Baikal
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "PROJECT_SQLITE_FILE", "label" => "SQLite file path", "validation" => "required", "inputclass" => "input-xxlarge", "help" => "The absolute server path to the SQLite file")));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "PROJECT_DB_MYSQL", "label" => "Use MySQL", "help" => "If checked, Baïkal will use MySQL instead of SQLite.", "refreshonchange" => TRUE)));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "PROJECT_DB_MYSQL_HOST", "label" => "MySQL host", "help" => "Host ip or name, including <strong>':portnumber'</strong> if port is not the default one (3306)")));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "PROJECT_DB_MYSQL_DBNAME", "label" => "MySQL database name")));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "PROJECT_DB_MYSQL_USERNAME", "label" => "MySQL username")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "PROJECT_DB_MYSQL_PASSWORD", "label" => "MySQL password")));
     return $oMorpho;
 }
예제 #2
0
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "uri", "label" => "Address Book token ID", "validation" => "required,tokenid", "popover" => array("title" => "Address Book token ID", "content" => "The unique identifier for this address book."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "displayname", "label" => "Display name", "validation" => "required", "popover" => array("title" => "Display name", "content" => "This is the name that will be displayed in your CardDAV client."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "description", "label" => "Description", "validation" => "required")));
     if ($this->floating()) {
         $oMorpho->element("uri")->setOption("help", "Allowed characters are digits, lowercase letters and the dash symbol '-'.");
     } else {
         $oMorpho->element("uri")->setOption("readonly", TRUE);
     }
     return $oMorpho;
 }
예제 #3
0
파일: User.php 프로젝트: Zyko0/Baikal
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "username", "label" => "Username", "validation" => "required,unique", "popover" => array("title" => "Username", "content" => "The login for this user account.<br />It has to be unique."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "displayname", "label" => "Display name", "validation" => "required", "popover" => array("title" => "Display name", "content" => "This is the name that will be displayed in your CalDAV/CardDAV clients."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "email", "label" => "Email", "validation" => "required,email")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "password", "label" => "Password")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "passwordconfirm", "label" => "Confirm password", "validation" => "sameas:password")));
     if ($this->floating()) {
         $oMorpho->element("username")->setOption("help", "May be an email, but not forcibly.");
         $oMorpho->element("password")->setOption("validation", "required");
     } else {
         $sNotice = "-- Leave empty to keep current password --";
         $oMorpho->element("username")->setOption("readonly", true);
         $oMorpho->element("password")->setOption("popover", array("title" => "Password", "content" => "Write something here only if you want to change the user password."));
         $oMorpho->element("passwordconfirm")->setOption("popover", array("title" => "Confirm password", "content" => "Write something here only if you want to change the user password."));
         $oMorpho->element("password")->setOption("placeholder", $sNotice);
         $oMorpho->element("passwordconfirm")->setOption("placeholder", $sNotice);
     }
     return $oMorpho;
 }
예제 #4
0
 function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Text(["prop" => "BAIKAL_CAL_BASEURI", "label" => "CalDAV base URI", "validation" => "required", "help" => "The absolute web path to cal.php", "popover" => ["title" => "CalDAV base URI", "content" => "If Baïkal is hosted in a subfolder, this path should reflect it.<br /><strong>Whatever happens, it should begin and end with a slash.</strong>"]]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "BAIKAL_CARD_BASEURI", "label" => "CardDAV base URI", "validation" => "required", "help" => "The absolute web path to card.php", "popover" => ["title" => "CardDAV base URI", "content" => "If Baïkal is hosted in a subfolder, this path should reflect it.<br /><strong>Whatever happens, it should begin and end with a slash.</strong>"]]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "BAIKAL_DAV_BASEURI", "label" => "CalDAV/CardDAV base URI", "validation" => "required", "help" => "The absolute web path to dav.php", "popover" => ["title" => "DAV base URI", "content" => "If Baïkal is hosted in a subfolder, this path should reflect it.<br /><strong>Whatever happens, it should begin and end with a slash.</strong>"]]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "BAIKAL_AUTH_REALM", "label" => "Auth realm", "validation" => "required", "help" => "Token used in authentication process.<br />If you change this, you'll have to reset all your users passwords.<br />You'll also loose access to this admin interface.", "popover" => ["title" => "Auth realm", "content" => "If you change this, you'll loose your access to this interface.<br />In other words: <strong>you should not change this, unless YKWYD.</strong>"]]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "PROJECT_SQLITE_FILE", "label" => "SQLite file path", "validation" => "required", "inputclass" => "input-xxlarge", "help" => "The absolute server path to the SQLite file"]));
     $oMorpho->add(new \Formal\Element\Checkbox(["prop" => "PROJECT_DB_MYSQL", "label" => "Use MySQL", "help" => "If checked, Baïkal will use MySQL instead of SQLite.", "refreshonchange" => true]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "PROJECT_DB_MYSQL_HOST", "label" => "MySQL host", "help" => "Host ip or name, including ':portnumber' if port is not the default one (3306)"]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "PROJECT_DB_MYSQL_DBNAME", "label" => "MySQL database name"]));
     $oMorpho->add(new \Formal\Element\Text(["prop" => "PROJECT_DB_MYSQL_USERNAME", "label" => "MySQL username"]));
     $oMorpho->add(new \Formal\Element\Password(["prop" => "PROJECT_DB_MYSQL_PASSWORD", "label" => "MySQL password"]));
     return $oMorpho;
 }
예제 #5
0
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "uri", "label" => "Calendar token ID", "validation" => "required,tokenid", "popover" => array("title" => "Calendar token ID", "content" => "The unique identifier for this calendar."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "displayname", "label" => "Display name", "validation" => "required", "popover" => array("title" => "Display name", "content" => "This is the name that will be displayed in your CalDAV client."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "calendarcolor", "label" => "Calendar color", "validation" => "color", "popover" => array("title" => "Calendar color", "content" => "This is the color that will be displayed in your CalDAV client.</br>" . "Must be supplied in format '#RRGGBBAA' (alpha channel optional) with hexadecimal values.</br>" . "This value is optional."))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "description", "label" => "Description")));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "todos", "label" => "Todos", "help" => "If checked, todos will be enabled on this calendar.")));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "notes", "label" => "Notes", "help" => "If checked, notes will be enabled on this calendar.")));
     if ($this->floating()) {
         $oMorpho->element("uri")->setOption("help", "Allowed characters are digits, lowercase letters and the dash symbol '-'.");
     } else {
         $oMorpho->element("uri")->setOption("readonly", TRUE);
     }
     return $oMorpho;
 }
예제 #6
0
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Listbox(array("prop" => "PROJECT_TIMEZONE", "label" => "Server Time zone", "validation" => "required", "options" => \Baikal\Core\Tools::timezones())));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_CAL_ENABLED", "label" => "Enable CalDAV")));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_CARD_ENABLED", "label" => "Enable CardDAV")));
     $oMorpho->add(new \Formal\Element\Listbox(array("prop" => "BAIKAL_DAV_AUTH_TYPE", "label" => "WebDAV authentication type", "options" => array("Digest", "Basic"))));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "BAIKAL_ADMIN_PASSWORDHASH", "label" => "Admin password")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "BAIKAL_ADMIN_PASSWORDHASH_CONFIRM", "label" => "Admin password, confirmation", "validation" => "sameas:BAIKAL_ADMIN_PASSWORDHASH")));
     if (!defined("BAIKAL_ADMIN_PASSWORDHASH") || trim(BAIKAL_ADMIN_PASSWORDHASH) === "") {
         # No password set (Form is used in install tool), so password is required as it has to be defined
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("validation", "required");
     } else {
         $sNotice = "-- Leave empty to keep current password --";
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("placeholder", $sNotice);
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH_CONFIRM")->setOption("placeholder", $sNotice);
     }
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_ADMIN_ENABLED", "label" => "Enable Web interface (recommended)", "popover" => array("title" => "Warning !", "content" => "If disabled, you'll lose access to this very admin interface !"))));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_ADMIN_AUTOLOCKENABLED", "label" => "Web interface autolock", "popover" => array("title" => "Web admin autolock", "content" => "If enabled, you'll have to create a file named <strong>ENABLE_ADMIN</strong> in the folder <strong>Specific/</strong> prior to every admin use.<br /><br />This enforces security, but might be uncomfortable if you use the admin frequently."))));
     return $oMorpho;
 }
예제 #7
0
 function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Listbox(["prop" => "PROJECT_TIMEZONE", "label" => "Server Time zone", "validation" => "required", "options" => \Baikal\Core\Tools::timezones()]));
     $oMorpho->add(new \Formal\Element\Checkbox(["prop" => "BAIKAL_CAL_ENABLED", "label" => "Enable CalDAV"]));
     $oMorpho->add(new \Formal\Element\Checkbox(["prop" => "BAIKAL_CARD_ENABLED", "label" => "Enable CardDAV"]));
     $oMorpho->add(new \Formal\Element\Listbox(["prop" => "BAIKAL_DAV_AUTH_TYPE", "label" => "WebDAV authentication type", "options" => ["Digest", "Basic"]]));
     $oMorpho->add(new \Formal\Element\Password(["prop" => "BAIKAL_ADMIN_PASSWORDHASH", "label" => "Admin password"]));
     $oMorpho->add(new \Formal\Element\Password(["prop" => "BAIKAL_ADMIN_PASSWORDHASH_CONFIRM", "label" => "Admin password, confirmation", "validation" => "sameas:BAIKAL_ADMIN_PASSWORDHASH"]));
     if (!defined("BAIKAL_ADMIN_PASSWORDHASH") || trim(BAIKAL_ADMIN_PASSWORDHASH) === "") {
         # No password set (Form is used in install tool), so password is required as it has to be defined
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("validation", "required");
     } else {
         $sNotice = "-- Leave empty to keep current password --";
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("placeholder", $sNotice);
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH_CONFIRM")->setOption("placeholder", $sNotice);
     }
     return $oMorpho;
 }
예제 #8
0
 public function formMorphologyForThisModelInstance()
 {
     $oMorpho = new \Formal\Form\Morphology();
     $oMorpho->add(new \Formal\Element\Listbox(array("prop" => "PROJECT_TIMEZONE", "label" => "Server Time zone", "validation" => "required", "options" => \Baikal\Core\Tools::timezones())));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_CAL_ENABLED", "label" => "Enable CalDAV")));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_CARD_ENABLED", "label" => "Enable CardDAV")));
     $oMorpho->add(new \Formal\Element\Listbox(array("prop" => "BAIKAL_DAV_AUTH_TYPE", "label" => "WebDAV authentication type", "options" => array("Digest", "Basic", "LDAP-UserBind", "Mail"))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "BAIKAL_DAV_LDAP_URI", "label" => "LDAP URI", "class" => "auth_ldap-userbind")));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "BAIKAL_DAV_LDAP_DN_TEMPLATE", "label" => "LDAP DN template", "class" => "auth_ldap-userbind", "popover" => array("title" => "posible placeholder", "content" => "<strong>%n</strong> - username<br /><strong>%u</strong> - user part of username , when it is an email address)<br /><strong>%d</strong> - domain part"))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "BAIKAL_DAV_LDAP_DISPLAYNAME_ATTR", "label" => "LDAP attribute for DisplayName", "class" => "auth_ldap-userbind")));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "BAIKAL_DAV_LDAP_EMAIL_ATTR", "label" => "LDAP attribute for eMail", "class" => "auth_ldap-userbind")));
     $oMorpho->add(new \Formal\Element\Listbox(array("prop" => "BAIKAL_DAV_MAIL_PROTOCOL", "label" => "MailAuth Protocol", "class" => "auth_mail", "options" => array("imap" => "imap (unencrypted)", "imaps" => "imaps (SSL)", "imaptls" => "imap (StartTLS)", "pop3" => "pop3 (unencrypted)", "pop3s" => "pop3s (SSL)", "pop3tls" => "pop3 (StartTLS)", "smtp" => "smtp (unencrypted)", "smtps" => "smtps (SSL)", "smtptls" => "smtp (StartTLS)"))));
     $oMorpho->add(new \Formal\Element\Text(array("prop" => "BAIKAL_DAV_MAIL_SERVER", "label" => "MailAuth Server", "class" => "auth_mail", "popover" => array("title" => "Format", "content" => "host:port"))));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_DAV_MAIL_CHECK_CERT", "label" => "MailAuth Check SSL-Certificate", "class" => "auth_mail auth_mail_ssl", "popover" => array("title" => "Security", "content" => "validate the server certificate"))));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_DAV_AUTO_CREATE_USER", "label" => "Automatic create users", "class" => "auth_mail auth_ldap-userbind")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "BAIKAL_ADMIN_PASSWORDHASH", "label" => "Admin password")));
     $oMorpho->add(new \Formal\Element\Password(array("prop" => "BAIKAL_ADMIN_PASSWORDHASH_CONFIRM", "label" => "Admin password, confirmation", "validation" => "sameas:BAIKAL_ADMIN_PASSWORDHASH")));
     if (!defined("BAIKAL_ADMIN_PASSWORDHASH") || trim(BAIKAL_ADMIN_PASSWORDHASH) === "") {
         # No password set (Form is used in install tool), so password is required as it has to be defined
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("validation", "required");
     } else {
         $sNotice = "-- Leave empty to keep current password --";
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH")->setOption("placeholder", $sNotice);
         $oMorpho->element("BAIKAL_ADMIN_PASSWORDHASH_CONFIRM")->setOption("placeholder", $sNotice);
     }
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_ADMIN_ENABLED", "label" => "Enable Web interface (recommended)", "popover" => array("title" => "Warning !", "content" => "If disabled, you'll lose access to this very admin interface !"))));
     $oMorpho->add(new \Formal\Element\Checkbox(array("prop" => "BAIKAL_ADMIN_AUTOLOCKENABLED", "label" => "Web interface autolock", "popover" => array("title" => "Web admin autolock", "content" => "If enabled, you'll have to create a file named <strong>ENABLE_ADMIN</strong> in the folder <strong>Specific/</strong> prior to every admin use.<br /><br />This enforces security, but might be uncomfortable if you use the admin frequently."))));
     return $oMorpho;
 }