remember_cookie_path: /companyfront.php # used by sfGuardSecurityUser.class.php. The scope of the Remeber cookie
remember_cookie_domain: .localhost
+ recaptcha:
+ private_key: 6Lcg9dESAAAAACrrfQ5l9OLp3nq93lN1ra1q-8Kn
+ public_key: 6Lcg9dESAAAAAG-QQLfE8By9c8ufO8WjuhBMz2-M
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 CompaniesRegisterForm();
+
+ if ($request->isMethod('post'))
+ {
+ $captcha = array('recaptcha_challenge_field' => $request->getParameter('recaptcha_challenge_field'),
+ 'recaptcha_response_field' => $request->getParameter('recaptcha_response_field'),
+ );
+ $this->form->bind(array_merge($request->getParameter($this->form->getName()), array('captcha' => $captcha)));
+ if ($this->form->isValid())
+ {
+ $user = $this->form->save();
+ $user->addPermissionByName('companies');
+ $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
+
+/**
+ * CompaniesRegisterForm for registering new users
+ *
+ * @package mobileadvertising
+ * @subpackage form
+ * @author Gustavo Martin Morcuende
+ * @version
+ */
+class CompaniesRegisterForm extends UsersRegisterForm
+{
+ /**
+ * @see sfForm
+ */
+ public function configure()
+ {
+ //Company creation form
+ $company = new Company();
+ $company->User = $this->getObject();
+ $newCompanyForm = new CompanyForm($company);
+
+ $this->embedForm('new', $newCompanyForm);
+
+ parent::configure();
+ }
+}