sf_guard_signout:
url: /logout
param: { module: sfGuardAuth, action: signout }
+
+register_index:
+ url: /register
+ param: { module: register, action: index }
--- /dev/null
+<?php
+
+/**
+ * api actions.
+ *
+ * @package mobileadvertising
+ * @subpackage api
+ * @author Gustavo Martin Morcuende
+ * @version
+ */
+class registerActions extends sfActions
+{
+ /**
+ * Executes index action
+ *
+ * @param sfRequest $request A request object
+ */
+ public function executeIndex(sfWebRequest $request)
+ {
+ if ($this->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');
+ }
+ }
+ }
+}
--- /dev/null
+
+
+index:
+ is_secure: false
--- /dev/null
+# 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
--- /dev/null
+<?php use_helper('I18N') ?>
+
+<form action="<?php echo url_for('@register_index') ?>" method="post">
+ <table>
+ <?php echo $form ?>
+ <tfoot>
+ <tr>
+ <td colspan="2">
+ <input type="submit" name="register" value="<?php echo __('Register', null, 'sf_guard') ?>" />
+ </td>
+ </tr>
+ </tfoot>
+ </table>
+</form>
--- /dev/null
+<?php use_helper('I18N') ?>
+<h1><?php echo __('Register', null, 'sf_guard') ?></h1>
+
+<?php include_partial('form', array('form' => $form)) ?>
<a href="<?php echo url_for('@sf_guard_forgot_password') ?>"><?php echo __('Forgot your password?', null, 'sf_guard') ?></a>
<?php endif; ?>
- <?php if (isset($routes['sf_guard_register'])): ?>
- <a href="<?php echo url_for('@sf_guard_register') ?>"><?php echo __('Want to register?', null, 'sf_guard') ?></a>
+ <?php if (isset($routes['register_index'])): ?>
+ <a href="<?php echo url_for('@register_index') ?>"><?php echo __('Want to register?', null, 'sf_guard') ?></a>
<?php endif; ?>
</td>
</tr>
--- /dev/null
+<?php
+
+/**
+ * UsersRegisterForm for registering new users
+ *
+ * @package mobileadvertising
+ * @subpackage form
+ * @author Gustavo Martin Morcuende
+ * @version
+ */
+class UsersRegisterForm extends BasesfGuardRegisterForm
+{
+ /**
+ * @see sfForm
+ */
+ public function configure()
+ {
+ $this->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));
+ }
+}
.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;