From: Gustavo Martin Morcuende Date: Sun, 27 May 2012 19:30:38 +0000 (+0200) Subject: Register users. Nice web page X-Git-Url: https://git.gumartinm.name/?a=commitdiff_plain;h=223ca3b273172957ff74008aefab17921e19937a;p=mobi%2F.git Register users. Nice web page --- diff --git a/apps/userfront/config/routing.yml b/apps/userfront/config/routing.yml index 9e69288..b09bdf3 100644 --- a/apps/userfront/config/routing.yml +++ b/apps/userfront/config/routing.yml @@ -59,3 +59,7 @@ sf_guard_signin: sf_guard_signout: url: /logout param: { module: sfGuardAuth, action: signout } + +register_index: + url: /register + param: { module: register, action: index } diff --git a/apps/userfront/modules/register/actions/actions.class.php b/apps/userfront/modules/register/actions/actions.class.php new file mode 100644 index 0000000..7c1aac2 --- /dev/null +++ b/apps/userfront/modules/register/actions/actions.class.php @@ -0,0 +1,42 @@ +getUser()->isAuthenticated()) + { + $this->getUser()->setFlash('notice', 'You are already registered and signed in!'); + $this->redirect('@homepage'); + } + + + $this->form = new UsersRegisterForm(); + + if ($request->isMethod('post')) + { + $this->form->bind($request->getParameter($this->form->getName())); + if ($this->form->isValid()) + { + $user = $this->form->save(); + $user->addPermissionByName('users'); + $this->getUser()->signIn($user); + + $this->redirect('@homepage'); + } + } + } +} diff --git a/apps/userfront/modules/register/config/security.yml b/apps/userfront/modules/register/config/security.yml new file mode 100644 index 0000000..72dcee0 --- /dev/null +++ b/apps/userfront/modules/register/config/security.yml @@ -0,0 +1,4 @@ + + +index: + is_secure: false diff --git a/apps/userfront/modules/register/config/view.yml b/apps/userfront/modules/register/config/view.yml new file mode 100644 index 0000000..4084c6e --- /dev/null +++ b/apps/userfront/modules/register/config/view.yml @@ -0,0 +1,20 @@ +# You can find more information about this file on the symfony website: +# http://www.symfony-project.org/reference/1_4/en/13-View + +default: + http_metas: + content-type: text/html + + metas: + #title: symfony project + #description: symfony project + #keywords: symfony, project + #language: en + #robots: index, follow + + stylesheets: [inadminpanel/style.css, inadminpanel/niceforms-default.css] + + javascripts: [jquery-1.6.2.min.js, inadminpanel/ddaccordion.js] + + has_layout: true + layout: layoutsfGuardAuth diff --git a/apps/userfront/modules/register/templates/_form.php b/apps/userfront/modules/register/templates/_form.php new file mode 100644 index 0000000..b4f9ba0 --- /dev/null +++ b/apps/userfront/modules/register/templates/_form.php @@ -0,0 +1,14 @@ + + +
+ + + + + + + +
+ +
+
diff --git a/apps/userfront/modules/register/templates/indexSuccess.php b/apps/userfront/modules/register/templates/indexSuccess.php new file mode 100644 index 0000000..f756829 --- /dev/null +++ b/apps/userfront/modules/register/templates/indexSuccess.php @@ -0,0 +1,4 @@ + +

+ + $form)) ?> diff --git a/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php b/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php index 924a8c7..b13e241 100644 --- a/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php +++ b/apps/userfront/modules/sfGuardAuth/templates/_signin_form.php @@ -15,8 +15,8 @@ - -   + +   diff --git a/lib/form/doctrine/UsersRegisterForm.class.php b/lib/form/doctrine/UsersRegisterForm.class.php new file mode 100644 index 0000000..96ec05b --- /dev/null +++ b/lib/form/doctrine/UsersRegisterForm.class.php @@ -0,0 +1,24 @@ +widgetSchema['language_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Language'), + 'add_empty' => false)); + + $this->validatorSchema['language_id'] = new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Language'), + 'required' => true)); + } +} diff --git a/web/css/inadminpanel/niceforms-default.css b/web/css/inadminpanel/niceforms-default.css index 3be17d9..96c7837 100644 --- a/web/css/inadminpanel/niceforms-default.css +++ b/web/css/inadminpanel/niceforms-default.css @@ -1,7 +1,7 @@ .login_form{ width:600px; -height:250px; -background:url(/images/inadminpanel/images/login_bg.png) no-repeat center top; +height:400px; +background: #FFFFFF no-repeat scroll center top; margin:20px 0 0 145px; float:left; padding:0px 0 0 0px;