From 9f108dd1a969473375341d92a7b1252fa2cedc9a Mon Sep 17 00:00:00 2001 From: mszulecki Date: Thu, 14 Jun 2007 17:09:01 +0000 Subject: Initial import. git-svn-id: http://svn.sukimashita.com/repos/mailadmin/trunk@2 4281df72-ff29-0410-8fee-2d9ac0c5f5a7 --- .../modules/address/actions/actions.class.php | 165 +++++++++++++++++++++ apps/admin/modules/address/config/generator.yml | 48 ++++++ apps/admin/modules/address/templates/_alias.php | 9 ++ .../modules/address/templates/_destination.php | 23 +++ .../admin/modules/address/templates/_domain_id.php | 1 + .../admin/modules/address/templates/_localpart.php | 1 + .../modules/address/templates/_mailbox_id.php | 1 + apps/admin/modules/address/validate/create.yml | 10 ++ apps/admin/modules/address/validate/edit.yml | 10 ++ .../modules/content/actions/actions.class.php | 18 +++ .../admin/modules/domain/actions/actions.class.php | 47 ++++++ apps/admin/modules/domain/config/generator.yml | 53 +++++++ apps/admin/modules/domain/config/security.yml | 11 ++ .../domain/templates/_default_mailbox_quota.php | 1 + .../modules/domain/templates/_edit_header.php | 13 ++ .../domain/templates/_max_mailbox_count.php | 1 + apps/admin/modules/domain/templates/_quota.php | 1 + apps/admin/modules/domain/validate/create.yml | 46 ++++++ apps/admin/modules/domain/validate/edit.yml | 46 ++++++ apps/admin/modules/log/actions/actions.class.php | 46 ++++++ apps/admin/modules/log/config/generator.yml | 30 ++++ apps/admin/modules/log/config/security.yml | 2 + apps/admin/modules/log/templates/_priority.php | 1 + apps/admin/modules/log/templates/_user_id.php | 1 + apps/admin/modules/log/templates/clearSuccess.php | 12 ++ .../modules/mailbox/actions/actions.class.php | 56 +++++++ apps/admin/modules/mailbox/config/generator.yml | 56 +++++++ .../admin/modules/mailbox/templates/_domain_id.php | 1 + .../modules/mailbox/templates/_last_login.php | 1 + .../mailbox/templates/_max_address_count.php | 1 + .../admin/modules/mailbox/templates/_max_quota.php | 1 + .../modules/mailbox/templates/_new_password.php | 1 + apps/admin/modules/mailbox/templates/_password.php | 1 + apps/admin/modules/mailbox/validate/create.yml | 50 +++++++ apps/admin/modules/mailbox/validate/edit.yml | 48 ++++++ .../admin/modules/server/actions/actions.class.php | 29 ++++ .../admin/modules/server/templates/imapSuccess.php | 57 +++++++ apps/admin/modules/user/actions/actions.class.php | 115 ++++++++++++++ apps/admin/modules/user/config/generator.yml | 55 +++++++ apps/admin/modules/user/config/security.yml | 13 ++ .../modules/user/templates/_domain_permissions.php | 27 ++++ apps/admin/modules/user/templates/_last_login.php | 1 + apps/admin/modules/user/templates/_password.php | 3 + apps/admin/modules/user/templates/_password1.php | 3 + apps/admin/modules/user/templates/_password2.php | 3 + apps/admin/modules/user/templates/_role_id.php | 1 + apps/admin/modules/user/templates/loginSuccess.php | 12 ++ .../modules/user/templates/settingsSuccess.php | 22 +++ apps/admin/modules/user/validate/create.yml | 37 +++++ apps/admin/modules/user/validate/edit.yml | 40 +++++ apps/admin/modules/user/validate/login.yml | 24 +++ apps/admin/modules/user/validate/settings.yml | 43 ++++++ 52 files changed, 1298 insertions(+) create mode 100644 apps/admin/modules/address/actions/actions.class.php create mode 100644 apps/admin/modules/address/config/generator.yml create mode 100644 apps/admin/modules/address/templates/_alias.php create mode 100644 apps/admin/modules/address/templates/_destination.php create mode 100644 apps/admin/modules/address/templates/_domain_id.php create mode 100644 apps/admin/modules/address/templates/_localpart.php create mode 100644 apps/admin/modules/address/templates/_mailbox_id.php create mode 100644 apps/admin/modules/address/validate/create.yml create mode 100644 apps/admin/modules/address/validate/edit.yml create mode 100644 apps/admin/modules/content/actions/actions.class.php create mode 100644 apps/admin/modules/domain/actions/actions.class.php create mode 100644 apps/admin/modules/domain/config/generator.yml create mode 100644 apps/admin/modules/domain/config/security.yml create mode 100644 apps/admin/modules/domain/templates/_default_mailbox_quota.php create mode 100644 apps/admin/modules/domain/templates/_edit_header.php create mode 100644 apps/admin/modules/domain/templates/_max_mailbox_count.php create mode 100644 apps/admin/modules/domain/templates/_quota.php create mode 100644 apps/admin/modules/domain/validate/create.yml create mode 100644 apps/admin/modules/domain/validate/edit.yml create mode 100644 apps/admin/modules/log/actions/actions.class.php create mode 100644 apps/admin/modules/log/config/generator.yml create mode 100644 apps/admin/modules/log/config/security.yml create mode 100644 apps/admin/modules/log/templates/_priority.php create mode 100644 apps/admin/modules/log/templates/_user_id.php create mode 100644 apps/admin/modules/log/templates/clearSuccess.php create mode 100644 apps/admin/modules/mailbox/actions/actions.class.php create mode 100644 apps/admin/modules/mailbox/config/generator.yml create mode 100644 apps/admin/modules/mailbox/templates/_domain_id.php create mode 100644 apps/admin/modules/mailbox/templates/_last_login.php create mode 100644 apps/admin/modules/mailbox/templates/_max_address_count.php create mode 100644 apps/admin/modules/mailbox/templates/_max_quota.php create mode 100644 apps/admin/modules/mailbox/templates/_new_password.php create mode 100644 apps/admin/modules/mailbox/templates/_password.php create mode 100644 apps/admin/modules/mailbox/validate/create.yml create mode 100644 apps/admin/modules/mailbox/validate/edit.yml create mode 100644 apps/admin/modules/server/actions/actions.class.php create mode 100644 apps/admin/modules/server/templates/imapSuccess.php create mode 100644 apps/admin/modules/user/actions/actions.class.php create mode 100644 apps/admin/modules/user/config/generator.yml create mode 100644 apps/admin/modules/user/config/security.yml create mode 100644 apps/admin/modules/user/templates/_domain_permissions.php create mode 100644 apps/admin/modules/user/templates/_last_login.php create mode 100644 apps/admin/modules/user/templates/_password.php create mode 100644 apps/admin/modules/user/templates/_password1.php create mode 100644 apps/admin/modules/user/templates/_password2.php create mode 100644 apps/admin/modules/user/templates/_role_id.php create mode 100644 apps/admin/modules/user/templates/loginSuccess.php create mode 100644 apps/admin/modules/user/templates/settingsSuccess.php create mode 100644 apps/admin/modules/user/validate/create.yml create mode 100644 apps/admin/modules/user/validate/edit.yml create mode 100644 apps/admin/modules/user/validate/login.yml create mode 100644 apps/admin/modules/user/validate/settings.yml (limited to 'apps/admin/modules') diff --git a/apps/admin/modules/address/actions/actions.class.php b/apps/admin/modules/address/actions/actions.class.php new file mode 100644 index 0000000..d042fbf --- /dev/null +++ b/apps/admin/modules/address/actions/actions.class.php @@ -0,0 +1,165 @@ +hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeCreate() + { + $this->setTemplate("edit"); + $result = $this->executeEdit(); + + if($this->getRequest()->getMethod() == sfRequest::GET) + { + if(!$this->hasRequestParameter("id")) + { + $this->updateAddressFromRequest(); + } + $this->address->setActive(true); + $this->address->setSaveInMailbox(true); + } + + return $result; + } + + public function handleErrorCreate() + { + $this->setTemplate("edit"); + return $this->handleErrorEdit(); + } + + public function validateCreate() + { + return $this->validateEdit(); + } + + public function validateEdit() + { + $i18n = sfI18N::getInstance(); + + if($this->getRequest()->getMethod() == sfRequest::GET) + return true; + + $newaddress = $this->getRequestParameter('address'); + if($newaddress["domain_id"]=='') + { + $this->getRequest()->setError('address{alias}', 'A domain must be selected'); + return false; + } + + $address = new Address(); + + if($this->getRequest()->hasParameter('id')) + $address = AddressPeer::retrieveByPk($this->getRequestParameter('id')); + + // if we got different values than the current record already has + if($this->getActionName()=="create" || + $address->getLocalpart() != $newaddress["localpart"] || + $address->getDomainId() != $newaddress["domain_id"] + ) + { + // check if localpart@domain is already used + $c = new Criteria(); + $c->add(AddressPeer::LOCALPART, $newaddress["localpart"]); + $c->add(AddressPeer::DOMAIN_ID, $newaddress["domain_id"]); + $checkaddress = AddressPeer::doSelectOne($c); + if($checkaddress) + { + $this->getRequest()->setError('address{alias}', $i18n->__('The address "%1%" already exists', array("%1%"=>$checkaddress))); + return false; + } + } + + // check if either save to mailbox option or destination is set to satisfy message routing + if(!isset($newaddress["save_in_mailbox"]) && $newaddress["destination"]=='') + { + $this->getRequest()->setError('address{save_in_mailbox}', 'If messages are not saved in the mailbox, the forward destination has to be set'); + $this->getRequest()->setError('address{destination}', 'Destination can not be empty if the message is not saved in the mailbox'); + return false; + + } + + // verify destination list + $ev = new sfEmailValidator(); + $destinations = Address::getDestinationAsArray($newaddress["destination"]); + foreach($destinations as $dest) + { + if($dest=='') + continue; + + // check email + if(strpos($dest, "@") !== false) + { + $error = ''; + $ev->initialize($this->getContext(), array( + 'email_error' => $i18n->__('Invalid E-Mail address "%1%"', array("%1%" => $dest)) + )); + + if(!$ev->execute($dest, $error)) + { + $this->getRequest()->setError('address{destination}', $error); + return false; + } + } + else // check if mailbox name is valid + { + // superadmin has all freedom + if($this->getUser()->hasCredential("superadmin")) + continue; + + $c = new Criteria(); + $c->add(MailboxPeer::NAME, $dest); + $mailbox = MailboxPeer::doSelectOne($c); + if(!$mailbox) + { + // no such target + $this->getRequest()->setError('address{destination}', $i18n->__('Mailbox "%1%" does not exist', array("%1%" => $dest))); + return false; + } + + // check permissions + $c = new Criteria(); + $c->add(DomainPermissionPeer::DOMAIN_ID, $mailbox->getDomainId()); + $permissions = $this->getUser()->getDomainPermissions($c); + if(!$permissions) + { + $this->getRequest()->setError('address{destination}', $i18n->__('No permissions to use Mailbox "%1%" as destination', array("%1%" => $dest))); + return false; + } + } + } + + return true; + } + + protected function updateAddressFromRequest() + { + $address = $this->getRequestParameter('address'); + + if (isset($address['localpart'])) + { + $this->address->setLocalpart($address['localpart']); + } + if (isset($address['domain_id'])) + { + $this->address->setDomainId($address['domain_id']); + } + + return parent::updateAddressFromRequest(); + } +} diff --git a/apps/admin/modules/address/config/generator.yml b/apps/admin/modules/address/config/generator.yml new file mode 100644 index 0000000..2bd2e44 --- /dev/null +++ b/apps/admin/modules/address/config/generator.yml @@ -0,0 +1,48 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: Address + theme: mailadmin + + fields: + destination: { name: Destination } + mailbox_id: { name: Mailbox } + active: { name: Active } + + list: + peer_method: doSelectJoinAll + title: List of Addresses + display: [=_localpart, _domain_id, _destination, active, _mailbox_id] + filters: [alias, domain_id, active, mailbox_id, destination] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [mailbox_id, asc] + fields: + localpart: { name: Address, params: align=right } + domain_id: { params: align=left } + alias: { params: align=left } + destination: { params: align=left } + active: { params: align=center width=1% } + mailbox_id: { params: align=right } + object_actions: + edit: { name: Edit Address, action: edit, icon: edit.gif } + delete: { name: Delete Address, action: delete, icon: trash.gif, params: confirm=Are you sure? } + actions: {} + + create: + title: Create New Address + + edit: + title: 'Editing Address %%alias%%' + display: + 'Address': [_alias, active, mailbox_id] + 'Destination': [save_in_mailbox, destination] + fields: + mailbox_id: { name: For Mailbox, help: 'The primary mailbox for this address' } + alias: { name: Address, help: 'Leave blank if this is a catch all address' } + save_in_mailbox: { name: Save to Mailbox, type: checkbox_tag, help: 'Incoming messages are saved, then forwarded' } + destination: { name: Forward to these Destinations, params: size=51x8, help: 'E-Mail addresses and/or mailbox names, one per line or comma-seperated' } + active: { name: Active, help: Inactive addresses are not routed } + actions: + _save_and_list: { name: Save } + _save_and_add: { name: 'Save, then create new one' } + _list: { name: Cancel } diff --git a/apps/admin/modules/address/templates/_alias.php b/apps/admin/modules/address/templates/_alias.php new file mode 100644 index 0000000..e6550c1 --- /dev/null +++ b/apps/admin/modules/address/templates/_alias.php @@ -0,0 +1,9 @@ + 25, + 'control_name' => 'address[localpart]', + 'style' => 'text-align:right', +)); echo $value ? $value : ' ' ?> @ 'Domain', + 'control_name' => 'address[domain_id]', + 'include_blank' => true, +)); echo $value ? $value : ' ' ?> diff --git a/apps/admin/modules/address/templates/_destination.php b/apps/admin/modules/address/templates/_destination.php new file mode 100644 index 0000000..f01676c --- /dev/null +++ b/apps/admin/modules/address/templates/_destination.php @@ -0,0 +1,23 @@ + +getDestination()); + if($address->getSaveInMailbox()) + $list = array_merge(array($address->getMailbox()->getName()), $list); +?> +
+ sfConfig::get('app_address_dest_collapse_count')): ?> + + count($list))), visual_effect( +'toggle_slide', 'addresslist_'.$address->getId())) ?> + + +
diff --git a/apps/admin/modules/address/templates/_domain_id.php b/apps/admin/modules/address/templates/_domain_id.php new file mode 100644 index 0000000..bb51b3d --- /dev/null +++ b/apps/admin/modules/address/templates/_domain_id.php @@ -0,0 +1 @@ +@getDomain() ?> diff --git a/apps/admin/modules/address/templates/_localpart.php b/apps/admin/modules/address/templates/_localpart.php new file mode 100644 index 0000000..e01fe5d --- /dev/null +++ b/apps/admin/modules/address/templates/_localpart.php @@ -0,0 +1 @@ +isCatchAll() ? "*": $address->getLocalpart() ) ?> diff --git a/apps/admin/modules/address/templates/_mailbox_id.php b/apps/admin/modules/address/templates/_mailbox_id.php new file mode 100644 index 0000000..0ab885b --- /dev/null +++ b/apps/admin/modules/address/templates/_mailbox_id.php @@ -0,0 +1 @@ +getMailbox() ?> diff --git a/apps/admin/modules/address/validate/create.yml b/apps/admin/modules/address/validate/create.yml new file mode 100644 index 0000000..a55efed --- /dev/null +++ b/apps/admin/modules/address/validate/create.yml @@ -0,0 +1,10 @@ +fillin: + enabled: true + +fields: + address{domain_id}: + required: + msg: A domain has to be selected + address{mailbox_id}: + required: + msg: A primary mailbox has to be selected diff --git a/apps/admin/modules/address/validate/edit.yml b/apps/admin/modules/address/validate/edit.yml new file mode 100644 index 0000000..a55efed --- /dev/null +++ b/apps/admin/modules/address/validate/edit.yml @@ -0,0 +1,10 @@ +fillin: + enabled: true + +fields: + address{domain_id}: + required: + msg: A domain has to be selected + address{mailbox_id}: + required: + msg: A primary mailbox has to be selected diff --git a/apps/admin/modules/content/actions/actions.class.php b/apps/admin/modules/content/actions/actions.class.php new file mode 100644 index 0000000..bbc9d08 --- /dev/null +++ b/apps/admin/modules/content/actions/actions.class.php @@ -0,0 +1,18 @@ +redirect($this->getRequest()->getReferer(), '@homepage'); + } +} diff --git a/apps/admin/modules/domain/actions/actions.class.php b/apps/admin/modules/domain/actions/actions.class.php new file mode 100644 index 0000000..badbf03 --- /dev/null +++ b/apps/admin/modules/domain/actions/actions.class.php @@ -0,0 +1,47 @@ +hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeCreate() + { + // populate preset values + $this->getRequest()->setParameter('domain[creator_id]', $this->getUser()->getId()); + + $this->setTemplate("edit"); + return $this->executeEdit(); + } + + public function handleErrorCreate() + { + $this->setTemplate("edit"); + return $this->handleErrorEdit(); + } + + public function executeCreateMailbox() + { + $domain = DomainPeer::retrieveByPk($this->getRequestParameter('id')); + $this->redirect("mailbox/create?mailbox[domain_id]=".$domain->getId()."&mailbox[name]=".sprintf("%s%d", $domain->getMailboxPrefix(), $domain->getMailboxCount()+1)."&mailbox[max_quota]=".$domain->getDefaultMailboxQuota() ); + } + + public function executeViewMailboxes() + { + $this->redirect("mailbox/list?filter=filter&filters[domain_id]=".$this->getRequestParameter('id')); + } +} diff --git a/apps/admin/modules/domain/config/generator.yml b/apps/admin/modules/domain/config/generator.yml new file mode 100644 index 0000000..df971b3 --- /dev/null +++ b/apps/admin/modules/domain/config/generator.yml @@ -0,0 +1,53 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: Domain + theme: mailadmin + + fields: + name: { name: Domain } + mailbox_prefix: { name: Mailbox Prefix } + max_mailbox_count: { name: Max Mailbox Count } + quota: { name: Quota } + creator: { name: Created by } + + list: + title: List of Domains + display: [=name, user, mailbox_prefix, _max_mailbox_count, _quota, _default_mailbox_quota] + filters: [name, mailbox_prefix, max_mailbox_count, quota, default_mailbox_quota] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [name, asc] + fields: + name: { params: align=left } + mailbox_prefix: { params: align=left } + user: { name: Created By, credentials: [[superadmin]] } + max_mailbox_count: { params: align=right } + mailbox_count: { params: align=right } + quota: { params: align=right } + default_mailbox_quota: { name: Default Mailbox Quota, params: align=right } + object_actions: + viewmailboxes: { name: View Mailboxes, action: viewMailboxes, icon: mail.gif } + createmailbox: { name: Create New Mailbox, action: createMailbox, icon: mail-new.gif } + edit: { name: Edit Domain, action: edit, icon: edit.gif, credentials: [[superadmin, domainmaster]] } + delete: { name: Delete Domain, action: delete, icon: trash.gif, credentials: [[superadmin, domainmaster]], params: confirm=Are you sure? } + actions: {} + + create: + title: Create New Domain + + edit: + title: 'Editing Domain %%name%%' + display: + 'General Settings': [name, mailbox_prefix] + 'Limits': [max_mailbox_count, quota, default_mailbox_quota] + fields: + name: { name: Domain Name, params: size=50 } + mailbox_prefix: { name: Prefix for new Mailboxes, params: size=50 onfocus='updatePrefixFromDomainName(this);' } + max_mailbox_count: { name: Maximum Number of Mailboxes, help: '0 = No Limit', params: size=50 } + quota: { name: Default Quota in kb, help: '0 = No Limit', params: size=50 } + default_mailbox_quota: { name: Quota for Domain in kb, help: '0 = No Limit', params: size=50 } + actions: + _save_and_list: { name: Save } + _save_and_add: { name: 'Save, then create new one' } + _list: { name: Cancel } + diff --git a/apps/admin/modules/domain/config/security.yml b/apps/admin/modules/domain/config/security.yml new file mode 100644 index 0000000..2431ebf --- /dev/null +++ b/apps/admin/modules/domain/config/security.yml @@ -0,0 +1,11 @@ +create: + is_secure: on + credentials: [[superadmin, domainmaster]] + +edit: + is_secure: on + credentials: [[superadmin, domainmaster]] + +all: + is_secure: on + diff --git a/apps/admin/modules/domain/templates/_default_mailbox_quota.php b/apps/admin/modules/domain/templates/_default_mailbox_quota.php new file mode 100644 index 0000000..272ad83 --- /dev/null +++ b/apps/admin/modules/domain/templates/_default_mailbox_quota.php @@ -0,0 +1 @@ +getDefaultMailboxQuota()==0 ? "Unlimited" : format_bytes($domain->getDefaultMailboxQuota()*1000)) ?> diff --git a/apps/admin/modules/domain/templates/_edit_header.php b/apps/admin/modules/domain/templates/_edit_header.php new file mode 100644 index 0000000..fed004a --- /dev/null +++ b/apps/admin/modules/domain/templates/_edit_header.php @@ -0,0 +1,13 @@ + + + diff --git a/apps/admin/modules/domain/templates/_max_mailbox_count.php b/apps/admin/modules/domain/templates/_max_mailbox_count.php new file mode 100644 index 0000000..8b7a70b --- /dev/null +++ b/apps/admin/modules/domain/templates/_max_mailbox_count.php @@ -0,0 +1 @@ +getMailboxCount() ?> / getMaxMailboxCount()==0 ? "Unlimited": $domain->getMaxMailboxCount()) ?> diff --git a/apps/admin/modules/domain/templates/_quota.php b/apps/admin/modules/domain/templates/_quota.php new file mode 100644 index 0000000..0b36b22 --- /dev/null +++ b/apps/admin/modules/domain/templates/_quota.php @@ -0,0 +1 @@ +getUsedQuota()*1000) ?> / getQuota()==0 ? "Unlimited" : format_bytes($domain->getQuota()*1000)) ?> diff --git a/apps/admin/modules/domain/validate/create.yml b/apps/admin/modules/domain/validate/create.yml new file mode 100644 index 0000000..c8183c2 --- /dev/null +++ b/apps/admin/modules/domain/validate/create.yml @@ -0,0 +1,46 @@ +fillin: + enabled: true + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + +fields: + domain{name}: + required: + msg: The Domain Name is required + myStringValidator: + sfRegexValidator: + match:..........Yes + match_error: 'The name must be in the form: example.org' + pattern: /[^.]+\.[^.]+$/si + sfPropelUniqueValidator: + class: Domain + column: name + unique_error: This domain already exists + domain{mailbox_prefix}: + required: + msg: The Mailbox Prefix is required + myStringValidator: + sfRegexValidator: + match: Yes + match_error: The prefix must only consist out of alphanumeric characters + pattern: /[A-z0-9]/si + sfPropelUniqueValidator: + class: Domain + column: mailbox_prefix + unique_error: This prefix already exists + domain{max_mailbox_count}: + required: + msg: The Mailbox Count is required + domain{quota}: + required: + msg: The Domain Quota is required + domain{default_mailbox_quota}: + required: + msg: The Mailbox Quota is required diff --git a/apps/admin/modules/domain/validate/edit.yml b/apps/admin/modules/domain/validate/edit.yml new file mode 100644 index 0000000..c8183c2 --- /dev/null +++ b/apps/admin/modules/domain/validate/edit.yml @@ -0,0 +1,46 @@ +fillin: + enabled: true + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + +fields: + domain{name}: + required: + msg: The Domain Name is required + myStringValidator: + sfRegexValidator: + match:..........Yes + match_error: 'The name must be in the form: example.org' + pattern: /[^.]+\.[^.]+$/si + sfPropelUniqueValidator: + class: Domain + column: name + unique_error: This domain already exists + domain{mailbox_prefix}: + required: + msg: The Mailbox Prefix is required + myStringValidator: + sfRegexValidator: + match: Yes + match_error: The prefix must only consist out of alphanumeric characters + pattern: /[A-z0-9]/si + sfPropelUniqueValidator: + class: Domain + column: mailbox_prefix + unique_error: This prefix already exists + domain{max_mailbox_count}: + required: + msg: The Mailbox Count is required + domain{quota}: + required: + msg: The Domain Quota is required + domain{default_mailbox_quota}: + required: + msg: The Mailbox Quota is required diff --git a/apps/admin/modules/log/actions/actions.class.php b/apps/admin/modules/log/actions/actions.class.php new file mode 100644 index 0000000..9eed7c7 --- /dev/null +++ b/apps/admin/modules/log/actions/actions.class.php @@ -0,0 +1,46 @@ +hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeClear() + { + if($this->getRequest()->getMethod() == sfRequest::POST) + { + if($this->getRequestParameter("commit")=="Yes") + { + LogEntryPeer::doDeleteAll(); + return $this->redirect("log", "list"); + } + + } + + return sfView::SUCCESS; + } + + public function executeCreate() + { + return $this->forward404(); + } + + public function executeEdit() + { + return $this->forward404(); + } +} diff --git a/apps/admin/modules/log/config/generator.yml b/apps/admin/modules/log/config/generator.yml new file mode 100644 index 0000000..553b1c2 --- /dev/null +++ b/apps/admin/modules/log/config/generator.yml @@ -0,0 +1,30 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: LogEntry + theme: mailadmin + + fields: + created_at: { name: Time } + user_id: { name: User } + host: { name: Host } + priority: { name: Type } + + list: + peer_method: doSelectJoinUser + title: Logs + display: [created_at, _priority, message, _user_id, host] + filters: [created_at, priority, message, user_id, host] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [created_at, desc] + fields: + created_at: { params: align=left center } + user_id: { params: align=left } + message: { params: align=left } + host: { params: align=left } + priority: { params: align=left } + object_actions: + delete: { name: Delete, action: delete, icon: trash.gif, params: confirm=Are you sure? } + actions: {} + + edit: {} diff --git a/apps/admin/modules/log/config/security.yml b/apps/admin/modules/log/config/security.yml new file mode 100644 index 0000000..60868c9 --- /dev/null +++ b/apps/admin/modules/log/config/security.yml @@ -0,0 +1,2 @@ +all: + credentials: [superadmin] diff --git a/apps/admin/modules/log/templates/_priority.php b/apps/admin/modules/log/templates/_priority.php new file mode 100644 index 0000000..2427ac7 --- /dev/null +++ b/apps/admin/modules/log/templates/_priority.php @@ -0,0 +1 @@ +getPriority()<3?"information.gif":($log_entry->getPriority()<4?"warning.gif":"error.gif")),"alt=[!] border=0") ?>getLevel() ?> diff --git a/apps/admin/modules/log/templates/_user_id.php b/apps/admin/modules/log/templates/_user_id.php new file mode 100644 index 0000000..737a1c7 --- /dev/null +++ b/apps/admin/modules/log/templates/_user_id.php @@ -0,0 +1 @@ +getUser() ? $log_entry->getUser(): "Anonymous") ?> diff --git a/apps/admin/modules/log/templates/clearSuccess.php b/apps/admin/modules/log/templates/clearSuccess.php new file mode 100644 index 0000000..83508eb --- /dev/null +++ b/apps/admin/modules/log/templates/clearSuccess.php @@ -0,0 +1,12 @@ +
+ +   +

Clear Log

+ +
+ +

Do you really want to remove all log entries?

+ +
+ +
diff --git a/apps/admin/modules/mailbox/actions/actions.class.php b/apps/admin/modules/mailbox/actions/actions.class.php new file mode 100644 index 0000000..566c69f --- /dev/null +++ b/apps/admin/modules/mailbox/actions/actions.class.php @@ -0,0 +1,56 @@ +hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeCreate() + { + $this->setTemplate("edit"); + $result = $this->executeEdit(); + + if($this->getRequest()->getMethod() == sfRequest::GET) + { + if(!$this->hasRequestParameter("id")) + { + $this->updateMailboxFromRequest(); + } + + // reset is needed as updateMailboxFromRequest() deactivates + $this->mailbox->setActive(true); + } + return $result; + } + + public function handleErrorCreate() + { + $this->setTemplate("edit"); + return $this->handleErrorEdit(); + } + + public function executeCreateAddress() + { + $mailbox = MailboxPeer::retrieveByPk($this->getRequestParameter('id')); + $this->redirect("address/create?address[mailbox_id]=".$this->getRequestParameter('id')."&address[domain_id]=".$mailbox->getDomainId()); + } + + public function executeViewAddresses() + { + $this->redirect("address/list?filter=filter&filters[mailbox_id]=".$this->getRequestParameter('id')); + } +} diff --git a/apps/admin/modules/mailbox/config/generator.yml b/apps/admin/modules/mailbox/config/generator.yml new file mode 100644 index 0000000..9c119ea --- /dev/null +++ b/apps/admin/modules/mailbox/config/generator.yml @@ -0,0 +1,56 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: Mailbox + theme: mailadmin + + fields: + domain: { name: Domain } + domain_id: { name: Domain } + name { name: Username } + max_quota: { name: Quota } + max_address_count: { name: Maximum Addresses } + last_login: { name: Last Login } + + list: + peer_method: doSelectJoinDomain + title: List of Mailboxes + display: [=name, _domain_id, _max_quota, _max_address_count, active, _last_login] + filters: [name, domain_id, max_quota, max_address_count, active, last_login] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [domain_id, asc] + fields: + name: { params: align=right } + domain_id: { params: align=left } + max_quota: { params: align=right } + max_address_count: { params: align=right } + active: { params: align=center width=1% } + last_login: { params: align=right } + object_actions: + viewaddresses: { name: View Addresses, action: viewAddresses, icon: address.gif } + createaddress: { name: Create New Address, action: createAddress, icon: address-new.gif } + edit: { name: Edit Mailbox, action: edit, icon: edit.gif } + delete: { name: Delete Mailbox, action: delete, icon: trash.gif, params: confirm=This will also remove all addresses for this mailbox. Are you sure? } + actions: {} + + create: + title: Create New Mailbox + + edit: + title: Editing Mailbox %%name%% + display: + 'General Settings': [name, _password, _new_password, domain_id, active] + 'Limits': [max_quota, max_address_count] + fields: + name: { name: Username, params: size=50 } + password: { name: Password, params: size=50, only_for: create } + new_password: { name: New Password, help: 'Enter a password to change it, leave the field blank to keep the current one', params: size=50, only_for: edit } + domain_id: { name: For Domain } + active: { name: Enable Login, help: 'Inactive mailboxes receive mail, however users are unable to login' } + max_quota: { name: Maximum Storage Space in kb, help: '0 = No Limit', params: size=50 } + max_address_count: { name: Maximum Number of Addresses, help: '0 = No Limit', params: size=50 } + actions: + _save_and_list: { name: Save } + _save_and_add: { name: 'Save, then create new one' } + _list: { name: Cancel } + diff --git a/apps/admin/modules/mailbox/templates/_domain_id.php b/apps/admin/modules/mailbox/templates/_domain_id.php new file mode 100644 index 0000000..4e93b4b --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_domain_id.php @@ -0,0 +1 @@ +getDomain()->getName() ?> diff --git a/apps/admin/modules/mailbox/templates/_last_login.php b/apps/admin/modules/mailbox/templates/_last_login.php new file mode 100644 index 0000000..6e0583a --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_last_login.php @@ -0,0 +1 @@ +getLastLogin()==""? "Never":$mailbox->getLastLogin()) ?> diff --git a/apps/admin/modules/mailbox/templates/_max_address_count.php b/apps/admin/modules/mailbox/templates/_max_address_count.php new file mode 100644 index 0000000..66cc68f --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_max_address_count.php @@ -0,0 +1 @@ +getAddressCount() ?> / getMaxAddressCount()==0 ? "Unlimited": $mailbox->getMaxAddressCount()) ?> diff --git a/apps/admin/modules/mailbox/templates/_max_quota.php b/apps/admin/modules/mailbox/templates/_max_quota.php new file mode 100644 index 0000000..3bf8c47 --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_max_quota.php @@ -0,0 +1 @@ +getQuota(); $qmax = ($q["max"] != null ? $q["max"]: $mailbox->getMaxQuota()); ?> / diff --git a/apps/admin/modules/mailbox/templates/_new_password.php b/apps/admin/modules/mailbox/templates/_new_password.php new file mode 100644 index 0000000..1c28ee6 --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_new_password.php @@ -0,0 +1 @@ + diff --git a/apps/admin/modules/mailbox/templates/_password.php b/apps/admin/modules/mailbox/templates/_password.php new file mode 100644 index 0000000..412f824 --- /dev/null +++ b/apps/admin/modules/mailbox/templates/_password.php @@ -0,0 +1 @@ + diff --git a/apps/admin/modules/mailbox/validate/create.yml b/apps/admin/modules/mailbox/validate/create.yml new file mode 100644 index 0000000..3668321 --- /dev/null +++ b/apps/admin/modules/mailbox/validate/create.yml @@ -0,0 +1,50 @@ +fillin: + enabled: true + param: + exclude_types: [password] + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + myPasswordValidator: + class: sfStringValidator + param: + min: 5 + min_error: The password is too short (5 characters minimum) + max: 100 + max_error: The password is too long (100 characters maximum) + +fields: + mailbox{name}: + required: + msg: The Username is required + myStringValidator: + sfRegexValidator: + match:..........Yes + match_error: 'The characters ".,;/" are not allowed' + pattern: '/[^.,;\/]$/i' + myDenyStringValidator: + values: [] + values_error: This Username is not allowed + sfPropelUniqueValidator: + class: Mailbox + column: name + unique_error: This Username already exists + mailbox{password}: + required: + msg: The Password is required + myPasswordValidator: + mailbox{domain_id}: + required: + msg: A Domain has to be specified + mailbox{max_quota}: + required: + msg: The Mailbox Quota is required + mailbox{max_address_count}: + required: + msg: The Maximum Address Count is required diff --git a/apps/admin/modules/mailbox/validate/edit.yml b/apps/admin/modules/mailbox/validate/edit.yml new file mode 100644 index 0000000..1629a9d --- /dev/null +++ b/apps/admin/modules/mailbox/validate/edit.yml @@ -0,0 +1,48 @@ +fillin: + enabled: true + param: + exclude_types: [password] + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + myPasswordValidator: + class: sfStringValidator + param: + min: 5 + min_error: The password is too short (5 characters minimum) + max: 100 + max_error: The password is too long (100 characters maximum) + +fields: + mailbox{name}: + required: + msg: The Username is required + myStringValidator: + sfRegexValidator: + match:..........Yes + match_error: 'The characters ".,;/" are not allowed' + pattern: '/[^.,;\/]$/i' + myDenyStringValidator: + values: [] + values_error: This Username is not allowed + sfPropelUniqueValidator: + class: Mailbox + column: name + unique_error: This Username already exists + mailbox{new_password}: + myPasswordValidator: + mailbox{domain_id}: + required: + msg: A Domain has to be specified + mailbox{max_quota}: + required: + msg: The Mailbox Quota is required + mailbox{max_address_count}: + required: + msg: The Maximum Address Count is required diff --git a/apps/admin/modules/server/actions/actions.class.php b/apps/admin/modules/server/actions/actions.class.php new file mode 100644 index 0000000..a83d9b9 --- /dev/null +++ b/apps/admin/modules/server/actions/actions.class.php @@ -0,0 +1,29 @@ +forward('server', 'imap'); + } + + public function executeImap() + { + $serverinfo = new IMAPServerInformation(); + $this->serverinfo = $serverinfo; + + return sfView::SUCCESS; + } +} diff --git a/apps/admin/modules/server/templates/imapSuccess.php b/apps/admin/modules/server/templates/imapSuccess.php new file mode 100644 index 0000000..57569ad --- /dev/null +++ b/apps/admin/modules/server/templates/imapSuccess.php @@ -0,0 +1,57 @@ +
+ +

IMAP Server Information

+ +
+ + + + + + + + + + + + + + + + + + + + + getServerName()) !== false): ?> + + + + + + + + + + + + + + + + + + hasCapability('ACL')): ?> + + + + + + + + +
Connection:
Host:getHost() ?>
Port:getPort() ?>
General:
Greeting:getGreeting() ?>
Server:getServerName() ?>
Version:getServerVersion() ?>
Hierarchy Delimiter:getHierarchyDelimiter() ?>
Capabilities:", $serverinfo->getCapabilties()) ?>
Extension: Access Control List (ACL)
Available ACL:getAvailableACL() ?>
+ +
+ +
diff --git a/apps/admin/modules/user/actions/actions.class.php b/apps/admin/modules/user/actions/actions.class.php new file mode 100644 index 0000000..1af2445 --- /dev/null +++ b/apps/admin/modules/user/actions/actions.class.php @@ -0,0 +1,115 @@ +hasRequestParameter("max_per_page")) + $this->getUser()->setResultsPerPage($this->getRequestParameter("max_per_page")); + + return parent::executeList(); + } + + public function executeCreate() + { + // populate preset values + $user = $this->getRequestParameter('user'); + $user["parent_user_id"] = $this->getUser()->getId(); + $this->getRequest()->setParameter('user', $user); + + $this->setTemplate("edit"); + return $this->executeEdit(); + } + + public function handleErrorCreate() + { + // populate preset values + $user = $this->getRequestParameter('user'); + $user["parent_user_id"] = $this->getUser()->getId(); + $this->getRequest()->setParameter('user', $user); + + $this->setTemplate("edit"); + return $this->handleErrorEdit(); + } + + public function executeLogin() + { + if($this->getRequest()->getMethod() != sfRequest::POST) + { + $this->getRequest()->setAttribute('referer', $this->getRequest()->getReferer()); + + return sfView::SUCCESS; + } + else + { + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + } + } + + public function handleErrorLogin() + { + return sfView::SUCCESS; + } + + public function executeSettings() + { + $user = UserPeer::retrieveByPK($this->getUser()->getId()); + $this->user = $user; + + if($this->getRequest()->getMethod() != sfRequest::POST) + { + $this->getRequest()->setAttribute('referer', $this->getRequest()->getReferer()); + } + else + { + if($this->getRequest()->getParameter("commit") == "Cancel") + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + + // update record + $user->setNickname($this->getRequestParameter("nickname")); + $user->setFirstName($this->getRequestParameter("first_name")); + $user->setLastName($this->getRequestParameter("last_name")); + $user->setEmail($this->getRequestParameter("email")); + + // set new password + $password = $this->getRequestParameter("password2"); + if($password != "") + $user->setPassword($password); + + $user->save(); + + // update session + $this->getUser()->updateUserAttributes($user); + + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + } + + return sfView::SUCCESS; + } + + public function handleErrorSettings() + { + $user = UserPeer::retrieveByPK($this->getUser()->getId()); + $this->user = $user; + + if($this->getRequest()->getParameter("commit") == "Cancel") + return $this->redirect($this->getRequestParameter('referer', '@homepage')); + + return sfView::SUCCESS; + } + + public function executeLogout() + { + $this->getUser()->signOut($user); + $this->redirect("@homepage"); + } +} diff --git a/apps/admin/modules/user/config/generator.yml b/apps/admin/modules/user/config/generator.yml new file mode 100644 index 0000000..4764f5b --- /dev/null +++ b/apps/admin/modules/user/config/generator.yml @@ -0,0 +1,55 @@ +generator: + class: sfPropelAdminGenerator + param: + model_class: User + theme: mailadmin + + fields: + nickname: { name: Nickname } + full_name: { name: Name } + email: { name: E-Mail } + last_login: { name: Last Login } + + list: + peer_method: doSelectJoinRole + title: List of Administrators + display: [=nickname, _role_id, _domain_permissions, full_name, email, _last_login] + filters: [nickname, role_id, email, parent_user_id, last_login, created_at] + max_per_page: '$this->getUser()->getResultsPerPage("pager")' + sort: [nickname, asc] + fields: + domain_permissions: { name: Associated Domains, params: align=left } + nickname: { params: align=left } + role_id: { params: align=left } + full_name: { params: align=left } + email: { params: align=left } + last_login: { params: align=right } + object_actions: + edit: { name: Edit, action: edit, icon: edit.gif } + delete: { name: Delete, action: delete, icon: trash.gif, params: confirm=Are you sure? } + actions: {} + + create: + title: Create New Administrator + + edit: + title: 'Editing Administrator %%nickname%%' + display: + 'General Settings': [nickname, first_name, last_name, email, parent_user_id] + 'Password Settings': [_password, _password2] + 'Permissions': [role_id, domain_permission] + fields: + domain_permission: { name: Assign Domains, type: admin_double_list, params: through_class=DomainPermission, help: Assign which domains the user is allowed to see (Ignored for superadmins) } + parent_user_id: { name: Parent User, only_for: edit } + nickname: { name: Nickname, params: size=50 } + first_name: { name: First Name, params: size=50 } + last_name: { name: Last Name, params: size=50 } + email: { name: E-Mail, params: size=50, help: Used for password requests or notifications } + role_id: { name: Role } + password: { name: Desired Password } + password2: { name: Re-Type New Password, only_for: edit, help: Leave blank if you do not want to change the password } + actions: + _save_and_list: { name: Save } + _save_and_add: { name: 'Save, then create new one' } + _list: { name: Cancel } + diff --git a/apps/admin/modules/user/config/security.yml b/apps/admin/modules/user/config/security.yml new file mode 100644 index 0000000..dbe3ebb --- /dev/null +++ b/apps/admin/modules/user/config/security.yml @@ -0,0 +1,13 @@ +settings: + is_secure: on + credentials: [] + +login: + is_secure: off + +logout: + is_secure: off + +all: + is_secure: on + credentials: [superadmin] diff --git a/apps/admin/modules/user/templates/_domain_permissions.php b/apps/admin/modules/user/templates/_domain_permissions.php new file mode 100644 index 0000000..0d3e19d --- /dev/null +++ b/apps/admin/modules/user/templates/_domain_permissions.php @@ -0,0 +1,27 @@ + +getRoleId() == Role::SUPERADMIN): ?> + + +getDomainPermissionsJoinDomain() ?> + + + +
+ sfConfig::get('app_user_domain_perm_collapse_count')): ?> + count($list))), visual_effect( +'toggle_slide', 'domain_permissionlist_'.$user->getId())) ?> + + +
+ + diff --git a/apps/admin/modules/user/templates/_last_login.php b/apps/admin/modules/user/templates/_last_login.php new file mode 100644 index 0000000..f15439a --- /dev/null +++ b/apps/admin/modules/user/templates/_last_login.php @@ -0,0 +1 @@ +getLastLogin() ? $user->getLastLogin(): "Never") ?> diff --git a/apps/admin/modules/user/templates/_password.php b/apps/admin/modules/user/templates/_password.php new file mode 100644 index 0000000..e32e4ab --- /dev/null +++ b/apps/admin/modules/user/templates/_password.php @@ -0,0 +1,3 @@ + 50, +)); echo $value ? $value : ' ' ?> diff --git a/apps/admin/modules/user/templates/_password1.php b/apps/admin/modules/user/templates/_password1.php new file mode 100644 index 0000000..e32e4ab --- /dev/null +++ b/apps/admin/modules/user/templates/_password1.php @@ -0,0 +1,3 @@ + 50, +)); echo $value ? $value : ' ' ?> diff --git a/apps/admin/modules/user/templates/_password2.php b/apps/admin/modules/user/templates/_password2.php new file mode 100644 index 0000000..eab912d --- /dev/null +++ b/apps/admin/modules/user/templates/_password2.php @@ -0,0 +1,3 @@ + 50, +)); echo $value ? $value : ' ' ?> diff --git a/apps/admin/modules/user/templates/_role_id.php b/apps/admin/modules/user/templates/_role_id.php new file mode 100644 index 0000000..bfaf818 --- /dev/null +++ b/apps/admin/modules/user/templates/_role_id.php @@ -0,0 +1 @@ +getRole() ?> diff --git a/apps/admin/modules/user/templates/loginSuccess.php b/apps/admin/modules/user/templates/loginSuccess.php new file mode 100644 index 0000000..f41a809 --- /dev/null +++ b/apps/admin/modules/user/templates/loginSuccess.php @@ -0,0 +1,12 @@ +
+ +   +

:

+
+ get("nickname"), "size=50") ?>
+
+ getAttribute('referer')) ?> +
+ + +
diff --git a/apps/admin/modules/user/templates/settingsSuccess.php b/apps/admin/modules/user/templates/settingsSuccess.php new file mode 100644 index 0000000..f1c49d7 --- /dev/null +++ b/apps/admin/modules/user/templates/settingsSuccess.php @@ -0,0 +1,22 @@ +
+ + +

Update Settings:

+ +
+ +

General Settings:

+ +
+
+
+
Used to retrieve your password or to send critical notifications


+ +

Change Password:

+
+
+ getAttribute('referer')) ?> + +
+ +
diff --git a/apps/admin/modules/user/validate/create.yml b/apps/admin/modules/user/validate/create.yml new file mode 100644 index 0000000..7686c7b --- /dev/null +++ b/apps/admin/modules/user/validate/create.yml @@ -0,0 +1,37 @@ +fillin: + enabled: true + param: + exclude_types: [password] + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + +fields: + user{nickname}: + required: + msg: The Username is required + sfStringValidator: + min: 5 + min_error: Username must be 5 or more characters + sfPropelUniqueValidator: + class: User + column: nickname + unique_error: This Username does already exist + user{email}: + myStringValidator: + sfEmailValidator: + email_error: This E-Mail Address is invalid + user{password}: + required: + msg: You must define a password + myStringValidator: + user{role_id}: + required: + msg: You must set a role for this user + diff --git a/apps/admin/modules/user/validate/edit.yml b/apps/admin/modules/user/validate/edit.yml new file mode 100644 index 0000000..6480b37 --- /dev/null +++ b/apps/admin/modules/user/validate/edit.yml @@ -0,0 +1,40 @@ +fillin: + enabled: true + param: + exclude_types: [password] + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + +fields: + user{nickname}: + required: + msg: The Username is required + sfStringValidator: + min: 5 + min_error: Username must be 5 or more characters + sfPropelUniqueValidator: + class: User + column: nickname + unique_error: This Username does already exist + user{email}: + myStringValidator: + sfEmailValidator: + email_error: This E-Mail Address is invalid + user{role_id}: + required: + msg: You must set a role for this user + user{password}: + group: password_group + user{password2}: + group: password_group + sfCompareValidator: + check: "user[password]" + compare_error: The two passwords do not match + diff --git a/apps/admin/modules/user/validate/login.yml b/apps/admin/modules/user/validate/login.yml new file mode 100644 index 0000000..d6ea563 --- /dev/null +++ b/apps/admin/modules/user/validate/login.yml @@ -0,0 +1,24 @@ +methods: + post: [nickname, password] + +names: + nickname: + required: true + required_msg: Your Username is required + validators: [nicknameValidator, userValidator] + + password: + required: true + required_msg: Your password is required + +nicknameValidator: + class: sfStringValidator + param: + min: 5 + min_error: Username must be 5 or more characters + +userValidator: + class: myLoginValidator + param: + password: password + login_error: This Username does not exist or you entered a wrong password diff --git a/apps/admin/modules/user/validate/settings.yml b/apps/admin/modules/user/validate/settings.yml new file mode 100644 index 0000000..0706d53 --- /dev/null +++ b/apps/admin/modules/user/validate/settings.yml @@ -0,0 +1,43 @@ +fillin: + enabled: true + param: + exclude_types: [password] + +validators: + myStringValidator: + class: sfStringValidator + param: + min: 2 + min_error: This field is too short (2 characters minimum) + max: 100 + max_error: This field is too long (100 characters maximum) + +fields: + nickname: + required: + msg: Your Username is required + sfStringValidator: + min: 5 + min_error: Username must be 5 or more characters + myChangeNicknameValidator: + change_error: This Username does already exist + + first_name: + myStringValidator: + last_name: + myStringValidator: + + email: + required: + msg: Your must provide an E-Mail Address + myStringValidator: + sfEmailValidator: + email_error: This E-Mail Address is invalid + + password1: + group: password_group + password2: + group: password_group + sfCompareValidator: + check: password1 + compare_error: The two passwords do not match -- cgit v1.1-32-gdbae