Skip to content
Browse files

добавил авторизацию перед входом в админку

  • Loading branch information...
1 parent f7e14f5 commit f2c25e53e0c19b7d7eb70672e6104061a6765941 @FladeX committed
Showing with 5,042 additions and 3 deletions.
  1. +1 −1 apps/backend/config/security.yml
  2. +13 −1 apps/backend/config/settings.yml
  3. +1 −1 apps/backend/lib/myUser.class.php
  4. +2 −0 apps/frontend/config/settings.yml
  5. +1 −0 config/ProjectConfiguration.class.php
  6. +16 −0 data/sql/schema.sql
  7. +95 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupFormFilter.class.php
  8. +95 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermissionFormFilter.class.php
  9. +119 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserFormFilter.class.php
  10. +16 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardGroupFormFilter.class.php
  11. +16 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardPermissionFormFilter.class.php
  12. +16 −0 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardUserFormFilter.class.php
  13. +155 −0 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupForm.class.php
  14. +155 −0 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermissionForm.class.php
  15. +174 −0 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserForm.class.php
  16. +16 −0 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardGroupForm.class.php
  17. +16 −0 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardPermissionForm.class.php
  18. +16 −0 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php
  19. +63 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardForgotPassword.class.php
  20. +74 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroup.class.php
  21. +64 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupPermission.class.php
  22. +74 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermission.class.php
  23. +62 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardRememberKey.class.php
  24. +156 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUser.class.php
  25. +64 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserGroup.class.php
  26. +64 −0 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserPermission.class.php
  27. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardForgotPassword.class.php
  28. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardForgotPasswordTable.class.php
  29. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroup.class.php
  30. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroupPermission.class.php
  31. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroupPermissionTable.class.php
  32. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroupTable.class.php
  33. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardPermission.class.php
  34. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardPermissionTable.class.php
  35. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardRememberKey.class.php
  36. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardRememberKeyTable.class.php
  37. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUser.class.php
  38. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUserGroup.class.php
  39. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUserGroupTable.class.php
  40. +15 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUserPermission.class.php
  41. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUserPermissionTable.class.php
  42. +19 −0 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardUserTable.class.php
  43. +1 −0 plugins/.channels/.alias/pear.txt
  44. +1 −0 plugins/.channels/.alias/pecl.txt
  45. +1 −0 plugins/.channels/.alias/phpdocs.txt
  46. +1 −0 plugins/.channels/.alias/symfony-plugins.txt
  47. +1 −0 plugins/.channels/.alias/symfony.txt
  48. +1 −0 plugins/.channels/__uri.reg
  49. +1 −0 plugins/.channels/doc.php.net.reg
  50. +1 −0 plugins/.channels/pear.php.net.reg
  51. +1 −0 plugins/.channels/pear.symfony-project.com.reg
  52. +1 −0 plugins/.channels/pecl.php.net.reg
  53. +1 −0 plugins/.channels/plugins.symfony-project.org.reg
  54. +1 −0 plugins/.depdb
  55. 0 plugins/.depdblock
  56. +1 −0 plugins/.filemap
  57. 0 plugins/.lock
  58. +4 −0 plugins/.registry/.channel.pear.symfony-project.com/symfony.reg
  59. +1 −0 plugins/.registry/.channel.plugins.symfony-project.org/sfdoctrineguardplugin.reg
  60. BIN plugins/sfDoctrineGuardPlugin/.DS_Store
  61. +7 −0 plugins/sfDoctrineGuardPlugin/LICENSE
  62. +305 −0 plugins/sfDoctrineGuardPlugin/README
  63. +1 −0 plugins/sfDoctrineGuardPlugin/VERSION
  64. +182 −0 plugins/sfDoctrineGuardPlugin/config/doctrine/schema.yml
  65. +40 −0 plugins/sfDoctrineGuardPlugin/config/sfDoctrineGuardPluginConfiguration.class.php
  66. +20 −0 plugins/sfDoctrineGuardPlugin/data/fixtures/fixtures.yml.sample
  67. 0 plugins/sfDoctrineGuardPlugin/data/tasks/.sf
  68. +33 −0 plugins/sfDoctrineGuardPlugin/i18n/sf_guard.es.xml
  69. +33 −0 plugins/sfDoctrineGuardPlugin/i18n/sf_guard.fr.xml
  70. +13 −0 plugins/sfDoctrineGuardPlugin/lib/filter/doctrine/PluginsfGuardGroupFormFilter.class.php
  71. +13 −0 plugins/sfDoctrineGuardPlugin/lib/filter/doctrine/PluginsfGuardPermissionFormFilter.class.php
  72. +13 −0 plugins/sfDoctrineGuardPlugin/lib/filter/doctrine/PluginsfGuardUserFormFilter.class.php
  73. +42 −0 plugins/sfDoctrineGuardPlugin/lib/form/base/BasesfGuardRequestForgotPasswordForm.class.php
  74. +28 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/PluginsfGuardGroupForm.class.php
  75. +25 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/PluginsfGuardPermissionForm.class.php
  76. +13 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/PluginsfGuardUserForm.class.php
  77. +27 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardChangeUserPasswordForm.class.php
  78. +40 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardFormSignin.class.php
  79. +27 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardRegisterForm.class.php
  80. +40 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/base/BasesfGuardUserAdminForm.class.php
  81. +19 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/sfGuardChangeUserPasswordForm.class.php
  82. +19 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/sfGuardFormSignin.class.php
  83. +19 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/sfGuardRegisterForm.class.php
  84. +19 −0 plugins/sfDoctrineGuardPlugin/lib/form/doctrine/sfGuardUserAdminForm.class.php
  85. +19 −0 plugins/sfDoctrineGuardPlugin/lib/form/sfGuardRequestForgotPasswordForm.class.php
  86. +16 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardForgotPassword.class.php
  87. +7 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardForgotPasswordTable.class.php
  88. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardGroup.class.php
  89. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardGroupPermission.class.php
  90. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardGroupPermissionTable.class.php
  91. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardGroupTable.class.php
  92. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardPermission.class.php
  93. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardPermissionTable.class.php
  94. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardRememberKey.class.php
  95. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardRememberKeyTable.class.php
  96. +292 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUser.class.php
  97. +18 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUserGroup.class.php
  98. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUserGroupTable.class.php
  99. +18 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUserPermission.class.php
  100. +13 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUserPermissionTable.class.php
  101. +48 −0 plugins/sfDoctrineGuardPlugin/lib/model/doctrine/PluginsfGuardUserTable.class.php
  102. +118 −0 plugins/sfDoctrineGuardPlugin/lib/routing/sfGuardRouting.class.php
  103. +56 −0 plugins/sfDoctrineGuardPlugin/lib/sfGuardBasicSecurityFilter.class.php
  104. +58 −0 plugins/sfDoctrineGuardPlugin/lib/sfGuardRememberMeFilter.class.php
  105. +66 −0 plugins/sfDoctrineGuardPlugin/lib/task/sfGuardAddGroupTask.class.php
  106. +66 −0 plugins/sfDoctrineGuardPlugin/lib/task/sfGuardAddPermissionTask.class.php
  107. +70 −0 plugins/sfDoctrineGuardPlugin/lib/task/sfGuardChangePasswordTask.class.php
  108. +71 −0 plugins/sfDoctrineGuardPlugin/lib/task/sfGuardCreateUserTask.class.php
  109. +70 −0 plugins/sfDoctrineGuardPlugin/lib/task/sfGuardPromoteSuperAdminTask.class.php
  110. +391 −0 plugins/sfDoctrineGuardPlugin/lib/user/sfGuardSecurityUser.class.php
  111. +69 −0 plugins/sfDoctrineGuardPlugin/lib/validator/sfGuardValidatorUser.class.php
  112. +22 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/actions/actions.class.php
  113. +22 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/actions/components.class.php
  114. +8 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/config/security.yml
  115. +89 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthActions.class.php
  116. +10 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/lib/BasesfGuardAuthComponents.class.php
  117. +25 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/templates/_signin_form.php
  118. +9 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/templates/secureSuccess.php
  119. +5 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardAuth/templates/signinSuccess.php
  120. +15 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardForgotPassword/actions/actions.class.php
  121. +95 −0 ...fDoctrineGuardPlugin/modules/sfGuardForgotPassword/lib/BasesfGuardForgotPasswordActions.class.php
  122. +7 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardForgotPassword/templates/_new_password.php
  123. +8 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardForgotPassword/templates/_send_request.php
  124. +13 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardForgotPassword/templates/changeSuccess.php
  125. +16 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardForgotPassword/templates/indexSuccess.php
  126. +16 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardGroup/actions/actions.class.php
  127. +25 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardGroup/config/generator.yml
  128. +13 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardGroup/lib/sfGuardGroupGeneratorConfiguration.class.php
  129. +13 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardGroup/lib/sfGuardGroupGeneratorHelper.class.php
  130. +16 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardPermission/actions/actions.class.php
  131. +25 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardPermission/config/generator.yml
  132. +13 −0 ...ctrineGuardPlugin/modules/sfGuardPermission/lib/sfGuardPermissionGeneratorConfiguration.class.php
  133. +13 −0 ...ns/sfDoctrineGuardPlugin/modules/sfGuardPermission/lib/sfGuardPermissionGeneratorHelper.class.php
  134. +15 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/actions/actions.class.php
  135. +7 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/actions/components.class.php
  136. +27 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/lib/BasesfGuardRegisterActions.class.php
  137. +9 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/lib/BasesfGuardRegisterComponents.class.php
  138. +14 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/templates/_form.php
  139. +4 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardRegister/templates/indexSuccess.php
  140. +16 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/actions/actions.class.php
  141. +31 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/config/generator.yml
  142. +20 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/lib/BasesfGuardUserActions.class.php
  143. +13 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/lib/sfGuardUserGeneratorConfiguration.class.php
  144. +13 −0 plugins/sfDoctrineGuardPlugin/modules/sfGuardUser/lib/sfGuardUserGeneratorHelper.class.php
  145. BIN plugins/sfDoctrineGuardPlugin/sfDoctrineGuardPlugin-5.0.0.tgz
View
2 apps/backend/config/security.yml
@@ -2,4 +2,4 @@
# http://www.symfony-project.org/reference/1_4/en/08-Security
default:
- is_secure: false
+ is_secure: true
View
14 apps/backend/config/settings.yml
@@ -23,7 +23,19 @@ test:
etag: false
all:
+ .actions:
+ default_module: projects
+ default_action: index
+
+ login_module: sfGuardAuth
+ login_action: signin
+
+ secure_module: sfGuardAuth
+ secure_action: secure
+
.settings:
+ enabled_modules: [default, sfGuardGroup, sfGuardUser, sfGuardPermission, sfGuardAuth]
+
# Form security secret (CSRF protection)
csrf_secret: 26193c53dc5e0b09e8c7fbe6a9d12c64ec5f7c22
@@ -32,4 +44,4 @@ all:
escaping_method: ESC_SPECIALCHARS
# Enable the database manager
- use_database: true
+ use_database: true
View
2 apps/backend/lib/myUser.class.php
@@ -1,5 +1,5 @@
<?php
-class myUser extends sfBasicSecurityUser
+class myUser extends sfGuardSecurityUser
{
}
View
2 apps/frontend/config/settings.yml
@@ -24,6 +24,8 @@ test:
all:
.settings:
+ enabled_modules: [default, sfGuardAuth]
+
# Form security secret (CSRF protection)
csrf_secret: 4dad8f1db6467357fb6d14016642707597ac213a
View
1 config/ProjectConfiguration.class.php
@@ -8,5 +8,6 @@ class ProjectConfiguration extends sfProjectConfiguration
public function setup()
{
$this->enablePlugins('sfDoctrinePlugin');
+ $this->enablePlugins('sfDoctrineGuardPlugin');
}
}
View
16 data/sql/schema.sql
@@ -6,6 +6,14 @@ CREATE TABLE projects (id BIGINT AUTO_INCREMENT, author_id BIGINT NOT NULL, titl
CREATE TABLE reports (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, project_id BIGINT NOT NULL, posting_name VARCHAR(255) NOT NULL, posting_password VARCHAR(255) NOT NULL, posting_messages BIGINT NOT NULL, posting_date DATETIME NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX project_id_idx (project_id), INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE reviews (id BIGINT AUTO_INCREMENT, author_id BIGINT NOT NULL, recepient_id BIGINT NOT NULL, text TEXT NOT NULL, type TINYINT(1) DEFAULT '1' NOT NULL, status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX recepient_id_idx (recepient_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE search_history (id BIGINT AUTO_INCREMENT, query VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_forgot_password (id BIGINT AUTO_INCREMENT, user_id BIGINT NOT NULL, unique_key VARCHAR(255), expires_at DATETIME NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_group (id BIGINT AUTO_INCREMENT, name VARCHAR(255) UNIQUE, description TEXT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_group_permission (group_id BIGINT, permission_id BIGINT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(group_id, permission_id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_permission (id BIGINT AUTO_INCREMENT, name VARCHAR(255) UNIQUE, description TEXT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_remember_key (id BIGINT AUTO_INCREMENT, user_id BIGINT, remember_key VARCHAR(32), ip_address VARCHAR(50), created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX user_id_idx (user_id), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_user (id BIGINT AUTO_INCREMENT, first_name VARCHAR(255), last_name VARCHAR(255), email_address VARCHAR(255) NOT NULL UNIQUE, username VARCHAR(128) NOT NULL UNIQUE, algorithm VARCHAR(128) DEFAULT 'sha1' NOT NULL, salt VARCHAR(128), password VARCHAR(128), is_active TINYINT(1) DEFAULT '1', is_super_admin TINYINT(1) DEFAULT '0', last_login DATETIME, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX is_active_idx_idx (is_active), PRIMARY KEY(id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_user_group (user_id BIGINT, group_id BIGINT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(user_id, group_id)) ENGINE = INNODB;
+CREATE TABLE sf_guard_user_permission (user_id BIGINT, permission_id BIGINT, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(user_id, permission_id)) ENGINE = INNODB;
CREATE TABLE users (id BIGINT AUTO_INCREMENT, user_name VARCHAR(255) NOT NULL, user_email VARCHAR(255) NOT NULL, user_status BIGINT DEFAULT 0 NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
ALTER TABLE badges ADD CONSTRAINT badges_user_id_users_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE bids ADD CONSTRAINT bids_user_id_users_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@@ -16,3 +24,11 @@ ALTER TABLE projects ADD CONSTRAINT projects_author_id_users_id FOREIGN KEY (aut
ALTER TABLE reports ADD CONSTRAINT reports_user_id_users_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE reports ADD CONSTRAINT reports_project_id_projects_id FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE reviews ADD CONSTRAINT reviews_recepient_id_users_id FOREIGN KEY (recepient_id) REFERENCES users(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_forgot_password ADD CONSTRAINT sf_guard_forgot_password_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_group_permission ADD CONSTRAINT sf_guard_group_permission_permission_id_sf_guard_permission_id FOREIGN KEY (permission_id) REFERENCES sf_guard_permission(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_group_permission ADD CONSTRAINT sf_guard_group_permission_group_id_sf_guard_group_id FOREIGN KEY (group_id) REFERENCES sf_guard_group(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_remember_key ADD CONSTRAINT sf_guard_remember_key_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_user_group ADD CONSTRAINT sf_guard_user_group_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_user_group ADD CONSTRAINT sf_guard_user_group_group_id_sf_guard_group_id FOREIGN KEY (group_id) REFERENCES sf_guard_group(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_user_permission ADD CONSTRAINT sf_guard_user_permission_user_id_sf_guard_user_id FOREIGN KEY (user_id) REFERENCES sf_guard_user(id) ON DELETE CASCADE;
+ALTER TABLE sf_guard_user_permission ADD CONSTRAINT sf_guard_user_permission_permission_id_sf_guard_permission_id FOREIGN KEY (permission_id) REFERENCES sf_guard_permission(id) ON DELETE CASCADE;
View
95 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupFormFilter.class.php
@@ -0,0 +1,95 @@
+<?php
+
+/**
+ * sfGuardGroup filter form base class.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardGroupFormFilter extends BaseFormFilterDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'name' => new sfWidgetFormFilterInput(),
+ 'description' => new sfWidgetFormFilterInput(),
+ 'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'users_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser')),
+ 'permissions_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission')),
+ ));
+
+ $this->setValidators(array(
+ 'name' => new sfValidatorPass(array('required' => false)),
+ 'description' => new sfValidatorPass(array('required' => false)),
+ 'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'users_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser', 'required' => false)),
+ 'permissions_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission', 'required' => false)),
+ ));
+
+ $this->widgetSchema->setNameFormat('sf_guard_group_filters[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function addUsersListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardUserGroup sfGuardUserGroup')
+ ->andWhereIn('sfGuardUserGroup.user_id', $values)
+ ;
+ }
+
+ public function addPermissionsListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardGroupPermission sfGuardGroupPermission')
+ ->andWhereIn('sfGuardGroupPermission.permission_id', $values)
+ ;
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardGroup';
+ }
+
+ public function getFields()
+ {
+ return array(
+ 'id' => 'Number',
+ 'name' => 'Text',
+ 'description' => 'Text',
+ 'created_at' => 'Date',
+ 'updated_at' => 'Date',
+ 'users_list' => 'ManyKey',
+ 'permissions_list' => 'ManyKey',
+ );
+ }
+}
View
95 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermissionFormFilter.class.php
@@ -0,0 +1,95 @@
+<?php
+
+/**
+ * sfGuardPermission filter form base class.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardPermissionFormFilter extends BaseFormFilterDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'name' => new sfWidgetFormFilterInput(),
+ 'description' => new sfWidgetFormFilterInput(),
+ 'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'groups_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup')),
+ 'users_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser')),
+ ));
+
+ $this->setValidators(array(
+ 'name' => new sfValidatorPass(array('required' => false)),
+ 'description' => new sfValidatorPass(array('required' => false)),
+ 'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'groups_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup', 'required' => false)),
+ 'users_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser', 'required' => false)),
+ ));
+
+ $this->widgetSchema->setNameFormat('sf_guard_permission_filters[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function addGroupsListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardGroupPermission sfGuardGroupPermission')
+ ->andWhereIn('sfGuardGroupPermission.group_id', $values)
+ ;
+ }
+
+ public function addUsersListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardUserPermission sfGuardUserPermission')
+ ->andWhereIn('sfGuardUserPermission.user_id', $values)
+ ;
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardPermission';
+ }
+
+ public function getFields()
+ {
+ return array(
+ 'id' => 'Number',
+ 'name' => 'Text',
+ 'description' => 'Text',
+ 'created_at' => 'Date',
+ 'updated_at' => 'Date',
+ 'groups_list' => 'ManyKey',
+ 'users_list' => 'ManyKey',
+ );
+ }
+}
View
119 lib/filter/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserFormFilter.class.php
@@ -0,0 +1,119 @@
+<?php
+
+/**
+ * sfGuardUser filter form base class.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardUserFormFilter extends BaseFormFilterDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'first_name' => new sfWidgetFormFilterInput(),
+ 'last_name' => new sfWidgetFormFilterInput(),
+ 'email_address' => new sfWidgetFormFilterInput(array('with_empty' => false)),
+ 'username' => new sfWidgetFormFilterInput(array('with_empty' => false)),
+ 'algorithm' => new sfWidgetFormFilterInput(array('with_empty' => false)),
+ 'salt' => new sfWidgetFormFilterInput(),
+ 'password' => new sfWidgetFormFilterInput(),
+ 'is_active' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
+ 'is_super_admin' => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
+ 'last_login' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
+ 'created_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'updated_at' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
+ 'groups_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup')),
+ 'permissions_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission')),
+ ));
+
+ $this->setValidators(array(
+ 'first_name' => new sfValidatorPass(array('required' => false)),
+ 'last_name' => new sfValidatorPass(array('required' => false)),
+ 'email_address' => new sfValidatorPass(array('required' => false)),
+ 'username' => new sfValidatorPass(array('required' => false)),
+ 'algorithm' => new sfValidatorPass(array('required' => false)),
+ 'salt' => new sfValidatorPass(array('required' => false)),
+ 'password' => new sfValidatorPass(array('required' => false)),
+ 'is_active' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
+ 'is_super_admin' => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
+ 'last_login' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'created_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'updated_at' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
+ 'groups_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup', 'required' => false)),
+ 'permissions_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission', 'required' => false)),
+ ));
+
+ $this->widgetSchema->setNameFormat('sf_guard_user_filters[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function addGroupsListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardUserGroup sfGuardUserGroup')
+ ->andWhereIn('sfGuardUserGroup.group_id', $values)
+ ;
+ }
+
+ public function addPermissionsListColumnQuery(Doctrine_Query $query, $field, $values)
+ {
+ if (!is_array($values))
+ {
+ $values = array($values);
+ }
+
+ if (!count($values))
+ {
+ return;
+ }
+
+ $query
+ ->leftJoin($query->getRootAlias().'.sfGuardUserPermission sfGuardUserPermission')
+ ->andWhereIn('sfGuardUserPermission.permission_id', $values)
+ ;
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardUser';
+ }
+
+ public function getFields()
+ {
+ return array(
+ 'id' => 'Number',
+ 'first_name' => 'Text',
+ 'last_name' => 'Text',
+ 'email_address' => 'Text',
+ 'username' => 'Text',
+ 'algorithm' => 'Text',
+ 'salt' => 'Text',
+ 'password' => 'Text',
+ 'is_active' => 'Boolean',
+ 'is_super_admin' => 'Boolean',
+ 'last_login' => 'Date',
+ 'created_at' => 'Date',
+ 'updated_at' => 'Date',
+ 'groups_list' => 'ManyKey',
+ 'permissions_list' => 'ManyKey',
+ );
+ }
+}
View
16 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardGroupFormFilter.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardGroup filter form.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardGroupFormFilter extends PluginsfGuardGroupFormFilter
+{
+ public function configure()
+ {
+ }
+}
View
16 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardPermissionFormFilter.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardPermission filter form.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardPermissionFormFilter extends PluginsfGuardPermissionFormFilter
+{
+ public function configure()
+ {
+ }
+}
View
16 lib/filter/doctrine/sfDoctrineGuardPlugin/sfGuardUserFormFilter.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardUser filter form.
+ *
+ * @package posting
+ * @subpackage filter
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter
+{
+ public function configure()
+ {
+ }
+}
View
155 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupForm.class.php
@@ -0,0 +1,155 @@
+<?php
+
+/**
+ * sfGuardGroup form base class.
+ *
+ * @method sfGuardGroup getObject() Returns the current form's model object
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardGroupForm extends BaseFormDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'id' => new sfWidgetFormInputHidden(),
+ 'name' => new sfWidgetFormInputText(),
+ 'description' => new sfWidgetFormTextarea(),
+ 'created_at' => new sfWidgetFormDateTime(),
+ 'updated_at' => new sfWidgetFormDateTime(),
+ 'users_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser')),
+ 'permissions_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission')),
+ ));
+
+ $this->setValidators(array(
+ 'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
+ 'name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'description' => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
+ 'created_at' => new sfValidatorDateTime(),
+ 'updated_at' => new sfValidatorDateTime(),
+ 'users_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser', 'required' => false)),
+ 'permissions_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission', 'required' => false)),
+ ));
+
+ $this->validatorSchema->setPostValidator(
+ new sfValidatorDoctrineUnique(array('model' => 'sfGuardGroup', 'column' => array('name')))
+ );
+
+ $this->widgetSchema->setNameFormat('sf_guard_group[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardGroup';
+ }
+
+ public function updateDefaultsFromObject()
+ {
+ parent::updateDefaultsFromObject();
+
+ if (isset($this->widgetSchema['users_list']))
+ {
+ $this->setDefault('users_list', $this->object->Users->getPrimaryKeys());
+ }
+
+ if (isset($this->widgetSchema['permissions_list']))
+ {
+ $this->setDefault('permissions_list', $this->object->Permissions->getPrimaryKeys());
+ }
+
+ }
+
+ protected function doSave($con = null)
+ {
+ $this->saveUsersList($con);
+ $this->savePermissionsList($con);
+
+ parent::doSave($con);
+ }
+
+ public function saveUsersList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['users_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Users->getPrimaryKeys();
+ $values = $this->getValue('users_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Users', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Users', array_values($link));
+ }
+ }
+
+ public function savePermissionsList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['permissions_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Permissions->getPrimaryKeys();
+ $values = $this->getValue('permissions_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Permissions', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Permissions', array_values($link));
+ }
+ }
+
+}
View
155 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermissionForm.class.php
@@ -0,0 +1,155 @@
+<?php
+
+/**
+ * sfGuardPermission form base class.
+ *
+ * @method sfGuardPermission getObject() Returns the current form's model object
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardPermissionForm extends BaseFormDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'id' => new sfWidgetFormInputHidden(),
+ 'name' => new sfWidgetFormInputText(),
+ 'description' => new sfWidgetFormTextarea(),
+ 'created_at' => new sfWidgetFormDateTime(),
+ 'updated_at' => new sfWidgetFormDateTime(),
+ 'groups_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup')),
+ 'users_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser')),
+ ));
+
+ $this->setValidators(array(
+ 'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
+ 'name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'description' => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
+ 'created_at' => new sfValidatorDateTime(),
+ 'updated_at' => new sfValidatorDateTime(),
+ 'groups_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup', 'required' => false)),
+ 'users_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardUser', 'required' => false)),
+ ));
+
+ $this->validatorSchema->setPostValidator(
+ new sfValidatorDoctrineUnique(array('model' => 'sfGuardPermission', 'column' => array('name')))
+ );
+
+ $this->widgetSchema->setNameFormat('sf_guard_permission[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardPermission';
+ }
+
+ public function updateDefaultsFromObject()
+ {
+ parent::updateDefaultsFromObject();
+
+ if (isset($this->widgetSchema['groups_list']))
+ {
+ $this->setDefault('groups_list', $this->object->Groups->getPrimaryKeys());
+ }
+
+ if (isset($this->widgetSchema['users_list']))
+ {
+ $this->setDefault('users_list', $this->object->Users->getPrimaryKeys());
+ }
+
+ }
+
+ protected function doSave($con = null)
+ {
+ $this->saveGroupsList($con);
+ $this->saveUsersList($con);
+
+ parent::doSave($con);
+ }
+
+ public function saveGroupsList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['groups_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Groups->getPrimaryKeys();
+ $values = $this->getValue('groups_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Groups', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Groups', array_values($link));
+ }
+ }
+
+ public function saveUsersList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['users_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Users->getPrimaryKeys();
+ $values = $this->getValue('users_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Users', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Users', array_values($link));
+ }
+ }
+
+}
View
174 lib/form/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserForm.class.php
@@ -0,0 +1,174 @@
+<?php
+
+/**
+ * sfGuardUser form base class.
+ *
+ * @method sfGuardUser getObject() Returns the current form's model object
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
+ */
+abstract class BasesfGuardUserForm extends BaseFormDoctrine
+{
+ public function setup()
+ {
+ $this->setWidgets(array(
+ 'id' => new sfWidgetFormInputHidden(),
+ 'first_name' => new sfWidgetFormInputText(),
+ 'last_name' => new sfWidgetFormInputText(),
+ 'email_address' => new sfWidgetFormInputText(),
+ 'username' => new sfWidgetFormInputText(),
+ 'algorithm' => new sfWidgetFormInputText(),
+ 'salt' => new sfWidgetFormInputText(),
+ 'password' => new sfWidgetFormInputText(),
+ 'is_active' => new sfWidgetFormInputCheckbox(),
+ 'is_super_admin' => new sfWidgetFormInputCheckbox(),
+ 'last_login' => new sfWidgetFormDateTime(),
+ 'created_at' => new sfWidgetFormDateTime(),
+ 'updated_at' => new sfWidgetFormDateTime(),
+ 'groups_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup')),
+ 'permissions_list' => new sfWidgetFormDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission')),
+ ));
+
+ $this->setValidators(array(
+ 'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
+ 'first_name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'last_name' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
+ 'email_address' => new sfValidatorString(array('max_length' => 255)),
+ 'username' => new sfValidatorString(array('max_length' => 128)),
+ 'algorithm' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
+ 'salt' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
+ 'password' => new sfValidatorString(array('max_length' => 128, 'required' => false)),
+ 'is_active' => new sfValidatorBoolean(array('required' => false)),
+ 'is_super_admin' => new sfValidatorBoolean(array('required' => false)),
+ 'last_login' => new sfValidatorDateTime(array('required' => false)),
+ 'created_at' => new sfValidatorDateTime(),
+ 'updated_at' => new sfValidatorDateTime(),
+ 'groups_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardGroup', 'required' => false)),
+ 'permissions_list' => new sfValidatorDoctrineChoice(array('multiple' => true, 'model' => 'sfGuardPermission', 'required' => false)),
+ ));
+
+ $this->validatorSchema->setPostValidator(
+ new sfValidatorAnd(array(
+ new sfValidatorDoctrineUnique(array('model' => 'sfGuardUser', 'column' => array('email_address'))),
+ new sfValidatorDoctrineUnique(array('model' => 'sfGuardUser', 'column' => array('username'))),
+ ))
+ );
+
+ $this->widgetSchema->setNameFormat('sf_guard_user[%s]');
+
+ $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
+
+ $this->setupInheritance();
+
+ parent::setup();
+ }
+
+ public function getModelName()
+ {
+ return 'sfGuardUser';
+ }
+
+ public function updateDefaultsFromObject()
+ {
+ parent::updateDefaultsFromObject();
+
+ if (isset($this->widgetSchema['groups_list']))
+ {
+ $this->setDefault('groups_list', $this->object->Groups->getPrimaryKeys());
+ }
+
+ if (isset($this->widgetSchema['permissions_list']))
+ {
+ $this->setDefault('permissions_list', $this->object->Permissions->getPrimaryKeys());
+ }
+
+ }
+
+ protected function doSave($con = null)
+ {
+ $this->saveGroupsList($con);
+ $this->savePermissionsList($con);
+
+ parent::doSave($con);
+ }
+
+ public function saveGroupsList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['groups_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Groups->getPrimaryKeys();
+ $values = $this->getValue('groups_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Groups', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Groups', array_values($link));
+ }
+ }
+
+ public function savePermissionsList($con = null)
+ {
+ if (!$this->isValid())
+ {
+ throw $this->getErrorSchema();
+ }
+
+ if (!isset($this->widgetSchema['permissions_list']))
+ {
+ // somebody has unset this widget
+ return;
+ }
+
+ if (null === $con)
+ {
+ $con = $this->getConnection();
+ }
+
+ $existing = $this->object->Permissions->getPrimaryKeys();
+ $values = $this->getValue('permissions_list');
+ if (!is_array($values))
+ {
+ $values = array();
+ }
+
+ $unlink = array_diff($existing, $values);
+ if (count($unlink))
+ {
+ $this->object->unlink('Permissions', array_values($unlink));
+ }
+
+ $link = array_diff($values, $existing);
+ if (count($link))
+ {
+ $this->object->link('Permissions', array_values($link));
+ }
+ }
+
+}
View
16 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardGroupForm.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardGroup form.
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardGroupForm extends PluginsfGuardGroupForm
+{
+ public function configure()
+ {
+ }
+}
View
16 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardPermissionForm.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardPermission form.
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardPermissionForm extends PluginsfGuardPermissionForm
+{
+ public function configure()
+ {
+ }
+}
View
16 lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php
@@ -0,0 +1,16 @@
+<?php
+
+/**
+ * sfGuardUser form.
+ *
+ * @package posting
+ * @subpackage form
+ * @author Your name here
+ * @version SVN: $Id: sfDoctrinePluginFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
+ */
+class sfGuardUserForm extends PluginsfGuardUserForm
+{
+ public function configure()
+ {
+ }
+}
View
63 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardForgotPassword.class.php
@@ -0,0 +1,63 @@
+<?php
+
+/**
+ * BasesfGuardForgotPassword
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property integer $user_id
+ * @property string $unique_key
+ * @property timestamp $expires_at
+ * @property sfGuardUser $User
+ *
+ * @method integer getUserId() Returns the current record's "user_id" value
+ * @method string getUniqueKey() Returns the current record's "unique_key" value
+ * @method timestamp getExpiresAt() Returns the current record's "expires_at" value
+ * @method sfGuardUser getUser() Returns the current record's "User" value
+ * @method sfGuardForgotPassword setUserId() Sets the current record's "user_id" value
+ * @method sfGuardForgotPassword setUniqueKey() Sets the current record's "unique_key" value
+ * @method sfGuardForgotPassword setExpiresAt() Sets the current record's "expires_at" value
+ * @method sfGuardForgotPassword setUser() Sets the current record's "User" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardForgotPassword extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_forgot_password');
+ $this->hasColumn('user_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'notnull' => true,
+ ));
+ $this->hasColumn('unique_key', 'string', 255, array(
+ 'type' => 'string',
+ 'length' => 255,
+ ));
+ $this->hasColumn('expires_at', 'timestamp', null, array(
+ 'type' => 'timestamp',
+ 'notnull' => true,
+ ));
+
+ $this->option('symfony', array(
+ 'form' => false,
+ 'filter' => false,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasOne('sfGuardUser as User', array(
+ 'local' => 'user_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
74 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroup.class.php
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * BasesfGuardGroup
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property string $name
+ * @property string $description
+ * @property Doctrine_Collection $Users
+ * @property Doctrine_Collection $Permissions
+ * @property Doctrine_Collection $sfGuardGroupPermission
+ * @property Doctrine_Collection $sfGuardUserGroup
+ *
+ * @method string getName() Returns the current record's "name" value
+ * @method string getDescription() Returns the current record's "description" value
+ * @method Doctrine_Collection getUsers() Returns the current record's "Users" collection
+ * @method Doctrine_Collection getPermissions() Returns the current record's "Permissions" collection
+ * @method Doctrine_Collection getSfGuardGroupPermission() Returns the current record's "sfGuardGroupPermission" collection
+ * @method Doctrine_Collection getSfGuardUserGroup() Returns the current record's "sfGuardUserGroup" collection
+ * @method sfGuardGroup setName() Sets the current record's "name" value
+ * @method sfGuardGroup setDescription() Sets the current record's "description" value
+ * @method sfGuardGroup setUsers() Sets the current record's "Users" collection
+ * @method sfGuardGroup setPermissions() Sets the current record's "Permissions" collection
+ * @method sfGuardGroup setSfGuardGroupPermission() Sets the current record's "sfGuardGroupPermission" collection
+ * @method sfGuardGroup setSfGuardUserGroup() Sets the current record's "sfGuardUserGroup" collection
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardGroup extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_group');
+ $this->hasColumn('name', 'string', 255, array(
+ 'type' => 'string',
+ 'unique' => true,
+ 'length' => 255,
+ ));
+ $this->hasColumn('description', 'string', 1000, array(
+ 'type' => 'string',
+ 'length' => 1000,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasMany('sfGuardUser as Users', array(
+ 'refClass' => 'sfGuardUserGroup',
+ 'local' => 'group_id',
+ 'foreign' => 'user_id'));
+
+ $this->hasMany('sfGuardPermission as Permissions', array(
+ 'refClass' => 'sfGuardGroupPermission',
+ 'local' => 'group_id',
+ 'foreign' => 'permission_id'));
+
+ $this->hasMany('sfGuardGroupPermission', array(
+ 'local' => 'id',
+ 'foreign' => 'group_id'));
+
+ $this->hasMany('sfGuardUserGroup', array(
+ 'local' => 'id',
+ 'foreign' => 'group_id'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
64 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardGroupPermission.class.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * BasesfGuardGroupPermission
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property integer $group_id
+ * @property integer $permission_id
+ * @property sfGuardGroup $Group
+ * @property sfGuardPermission $Permission
+ *
+ * @method integer getGroupId() Returns the current record's "group_id" value
+ * @method integer getPermissionId() Returns the current record's "permission_id" value
+ * @method sfGuardGroup getGroup() Returns the current record's "Group" value
+ * @method sfGuardPermission getPermission() Returns the current record's "Permission" value
+ * @method sfGuardGroupPermission setGroupId() Sets the current record's "group_id" value
+ * @method sfGuardGroupPermission setPermissionId() Sets the current record's "permission_id" value
+ * @method sfGuardGroupPermission setGroup() Sets the current record's "Group" value
+ * @method sfGuardGroupPermission setPermission() Sets the current record's "Permission" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardGroupPermission extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_group_permission');
+ $this->hasColumn('group_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+ $this->hasColumn('permission_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+
+ $this->option('symfony', array(
+ 'form' => false,
+ 'filter' => false,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasOne('sfGuardGroup as Group', array(
+ 'local' => 'group_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $this->hasOne('sfGuardPermission as Permission', array(
+ 'local' => 'permission_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
74 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardPermission.class.php
@@ -0,0 +1,74 @@
+<?php
+
+/**
+ * BasesfGuardPermission
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property string $name
+ * @property string $description
+ * @property Doctrine_Collection $Groups
+ * @property Doctrine_Collection $sfGuardGroupPermission
+ * @property Doctrine_Collection $Users
+ * @property Doctrine_Collection $sfGuardUserPermission
+ *
+ * @method string getName() Returns the current record's "name" value
+ * @method string getDescription() Returns the current record's "description" value
+ * @method Doctrine_Collection getGroups() Returns the current record's "Groups" collection
+ * @method Doctrine_Collection getSfGuardGroupPermission() Returns the current record's "sfGuardGroupPermission" collection
+ * @method Doctrine_Collection getUsers() Returns the current record's "Users" collection
+ * @method Doctrine_Collection getSfGuardUserPermission() Returns the current record's "sfGuardUserPermission" collection
+ * @method sfGuardPermission setName() Sets the current record's "name" value
+ * @method sfGuardPermission setDescription() Sets the current record's "description" value
+ * @method sfGuardPermission setGroups() Sets the current record's "Groups" collection
+ * @method sfGuardPermission setSfGuardGroupPermission() Sets the current record's "sfGuardGroupPermission" collection
+ * @method sfGuardPermission setUsers() Sets the current record's "Users" collection
+ * @method sfGuardPermission setSfGuardUserPermission() Sets the current record's "sfGuardUserPermission" collection
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardPermission extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_permission');
+ $this->hasColumn('name', 'string', 255, array(
+ 'type' => 'string',
+ 'unique' => true,
+ 'length' => 255,
+ ));
+ $this->hasColumn('description', 'string', 1000, array(
+ 'type' => 'string',
+ 'length' => 1000,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasMany('sfGuardGroup as Groups', array(
+ 'refClass' => 'sfGuardGroupPermission',
+ 'local' => 'permission_id',
+ 'foreign' => 'group_id'));
+
+ $this->hasMany('sfGuardGroupPermission', array(
+ 'local' => 'id',
+ 'foreign' => 'permission_id'));
+
+ $this->hasMany('sfGuardUser as Users', array(
+ 'refClass' => 'sfGuardUserPermission',
+ 'local' => 'permission_id',
+ 'foreign' => 'user_id'));
+
+ $this->hasMany('sfGuardUserPermission', array(
+ 'local' => 'id',
+ 'foreign' => 'permission_id'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
62 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardRememberKey.class.php
@@ -0,0 +1,62 @@
+<?php
+
+/**
+ * BasesfGuardRememberKey
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property integer $user_id
+ * @property string $remember_key
+ * @property string $ip_address
+ * @property sfGuardUser $User
+ *
+ * @method integer getUserId() Returns the current record's "user_id" value
+ * @method string getRememberKey() Returns the current record's "remember_key" value
+ * @method string getIpAddress() Returns the current record's "ip_address" value
+ * @method sfGuardUser getUser() Returns the current record's "User" value
+ * @method sfGuardRememberKey setUserId() Sets the current record's "user_id" value
+ * @method sfGuardRememberKey setRememberKey() Sets the current record's "remember_key" value
+ * @method sfGuardRememberKey setIpAddress() Sets the current record's "ip_address" value
+ * @method sfGuardRememberKey setUser() Sets the current record's "User" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardRememberKey extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_remember_key');
+ $this->hasColumn('user_id', 'integer', null, array(
+ 'type' => 'integer',
+ ));
+ $this->hasColumn('remember_key', 'string', 32, array(
+ 'type' => 'string',
+ 'length' => 32,
+ ));
+ $this->hasColumn('ip_address', 'string', 50, array(
+ 'type' => 'string',
+ 'length' => 50,
+ ));
+
+ $this->option('symfony', array(
+ 'form' => false,
+ 'filter' => false,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasOne('sfGuardUser as User', array(
+ 'local' => 'user_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
156 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUser.class.php
@@ -0,0 +1,156 @@
+<?php
+
+/**
+ * BasesfGuardUser
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property string $first_name
+ * @property string $last_name
+ * @property string $email_address
+ * @property string $username
+ * @property string $algorithm
+ * @property string $salt
+ * @property string $password
+ * @property boolean $is_active
+ * @property boolean $is_super_admin
+ * @property timestamp $last_login
+ * @property Doctrine_Collection $Groups
+ * @property Doctrine_Collection $Permissions
+ * @property Doctrine_Collection $sfGuardUserPermission
+ * @property Doctrine_Collection $sfGuardUserGroup
+ * @property sfGuardRememberKey $RememberKeys
+ * @property sfGuardForgotPassword $ForgotPassword
+ *
+ * @method string getFirstName() Returns the current record's "first_name" value
+ * @method string getLastName() Returns the current record's "last_name" value
+ * @method string getEmailAddress() Returns the current record's "email_address" value
+ * @method string getUsername() Returns the current record's "username" value
+ * @method string getAlgorithm() Returns the current record's "algorithm" value
+ * @method string getSalt() Returns the current record's "salt" value
+ * @method string getPassword() Returns the current record's "password" value
+ * @method boolean getIsActive() Returns the current record's "is_active" value
+ * @method boolean getIsSuperAdmin() Returns the current record's "is_super_admin" value
+ * @method timestamp getLastLogin() Returns the current record's "last_login" value
+ * @method Doctrine_Collection getGroups() Returns the current record's "Groups" collection
+ * @method Doctrine_Collection getPermissions() Returns the current record's "Permissions" collection
+ * @method Doctrine_Collection getSfGuardUserPermission() Returns the current record's "sfGuardUserPermission" collection
+ * @method Doctrine_Collection getSfGuardUserGroup() Returns the current record's "sfGuardUserGroup" collection
+ * @method sfGuardRememberKey getRememberKeys() Returns the current record's "RememberKeys" value
+ * @method sfGuardForgotPassword getForgotPassword() Returns the current record's "ForgotPassword" value
+ * @method sfGuardUser setFirstName() Sets the current record's "first_name" value
+ * @method sfGuardUser setLastName() Sets the current record's "last_name" value
+ * @method sfGuardUser setEmailAddress() Sets the current record's "email_address" value
+ * @method sfGuardUser setUsername() Sets the current record's "username" value
+ * @method sfGuardUser setAlgorithm() Sets the current record's "algorithm" value
+ * @method sfGuardUser setSalt() Sets the current record's "salt" value
+ * @method sfGuardUser setPassword() Sets the current record's "password" value
+ * @method sfGuardUser setIsActive() Sets the current record's "is_active" value
+ * @method sfGuardUser setIsSuperAdmin() Sets the current record's "is_super_admin" value
+ * @method sfGuardUser setLastLogin() Sets the current record's "last_login" value
+ * @method sfGuardUser setGroups() Sets the current record's "Groups" collection
+ * @method sfGuardUser setPermissions() Sets the current record's "Permissions" collection
+ * @method sfGuardUser setSfGuardUserPermission() Sets the current record's "sfGuardUserPermission" collection
+ * @method sfGuardUser setSfGuardUserGroup() Sets the current record's "sfGuardUserGroup" collection
+ * @method sfGuardUser setRememberKeys() Sets the current record's "RememberKeys" value
+ * @method sfGuardUser setForgotPassword() Sets the current record's "ForgotPassword" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardUser extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_user');
+ $this->hasColumn('first_name', 'string', 255, array(
+ 'type' => 'string',
+ 'length' => 255,
+ ));
+ $this->hasColumn('last_name', 'string', 255, array(
+ 'type' => 'string',
+ 'length' => 255,
+ ));
+ $this->hasColumn('email_address', 'string', 255, array(
+ 'type' => 'string',
+ 'notnull' => true,
+ 'unique' => true,
+ 'length' => 255,
+ ));
+ $this->hasColumn('username', 'string', 128, array(
+ 'type' => 'string',
+ 'notnull' => true,
+ 'unique' => true,
+ 'length' => 128,
+ ));
+ $this->hasColumn('algorithm', 'string', 128, array(
+ 'type' => 'string',
+ 'default' => 'sha1',
+ 'notnull' => true,
+ 'length' => 128,
+ ));
+ $this->hasColumn('salt', 'string', 128, array(
+ 'type' => 'string',
+ 'length' => 128,
+ ));
+ $this->hasColumn('password', 'string', 128, array(
+ 'type' => 'string',
+ 'length' => 128,
+ ));
+ $this->hasColumn('is_active', 'boolean', null, array(
+ 'type' => 'boolean',
+ 'default' => 1,
+ ));
+ $this->hasColumn('is_super_admin', 'boolean', null, array(
+ 'type' => 'boolean',
+ 'default' => false,
+ ));
+ $this->hasColumn('last_login', 'timestamp', null, array(
+ 'type' => 'timestamp',
+ ));
+
+
+ $this->index('is_active_idx', array(
+ 'fields' =>
+ array(
+ 0 => 'is_active',
+ ),
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasMany('sfGuardGroup as Groups', array(
+ 'refClass' => 'sfGuardUserGroup',
+ 'local' => 'user_id',
+ 'foreign' => 'group_id'));
+
+ $this->hasMany('sfGuardPermission as Permissions', array(
+ 'refClass' => 'sfGuardUserPermission',
+ 'local' => 'user_id',
+ 'foreign' => 'permission_id'));
+
+ $this->hasMany('sfGuardUserPermission', array(
+ 'local' => 'id',
+ 'foreign' => 'user_id'));
+
+ $this->hasMany('sfGuardUserGroup', array(
+ 'local' => 'id',
+ 'foreign' => 'user_id'));
+
+ $this->hasOne('sfGuardRememberKey as RememberKeys', array(
+ 'local' => 'id',
+ 'foreign' => 'user_id'));
+
+ $this->hasOne('sfGuardForgotPassword as ForgotPassword', array(
+ 'local' => 'id',
+ 'foreign' => 'user_id'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
64 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserGroup.class.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * BasesfGuardUserGroup
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property integer $user_id
+ * @property integer $group_id
+ * @property sfGuardUser $User
+ * @property sfGuardGroup $Group
+ *
+ * @method integer getUserId() Returns the current record's "user_id" value
+ * @method integer getGroupId() Returns the current record's "group_id" value
+ * @method sfGuardUser getUser() Returns the current record's "User" value
+ * @method sfGuardGroup getGroup() Returns the current record's "Group" value
+ * @method sfGuardUserGroup setUserId() Sets the current record's "user_id" value
+ * @method sfGuardUserGroup setGroupId() Sets the current record's "group_id" value
+ * @method sfGuardUserGroup setUser() Sets the current record's "User" value
+ * @method sfGuardUserGroup setGroup() Sets the current record's "Group" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardUserGroup extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_user_group');
+ $this->hasColumn('user_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+ $this->hasColumn('group_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+
+ $this->option('symfony', array(
+ 'form' => false,
+ 'filter' => false,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasOne('sfGuardUser as User', array(
+ 'local' => 'user_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $this->hasOne('sfGuardGroup as Group', array(
+ 'local' => 'group_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
64 lib/model/doctrine/sfDoctrineGuardPlugin/base/BasesfGuardUserPermission.class.php
@@ -0,0 +1,64 @@
+<?php
+
+/**
+ * BasesfGuardUserPermission
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @property integer $user_id
+ * @property integer $permission_id
+ * @property sfGuardUser $User
+ * @property sfGuardPermission $Permission
+ *
+ * @method integer getUserId() Returns the current record's "user_id" value
+ * @method integer getPermissionId() Returns the current record's "permission_id" value
+ * @method sfGuardUser getUser() Returns the current record's "User" value
+ * @method sfGuardPermission getPermission() Returns the current record's "Permission" value
+ * @method sfGuardUserPermission setUserId() Sets the current record's "user_id" value
+ * @method sfGuardUserPermission setPermissionId() Sets the current record's "permission_id" value
+ * @method sfGuardUserPermission setUser() Sets the current record's "User" value
+ * @method sfGuardUserPermission setPermission() Sets the current record's "Permission" value
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+abstract class BasesfGuardUserPermission extends sfDoctrineRecord
+{
+ public function setTableDefinition()
+ {
+ $this->setTableName('sf_guard_user_permission');
+ $this->hasColumn('user_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+ $this->hasColumn('permission_id', 'integer', null, array(
+ 'type' => 'integer',
+ 'primary' => true,
+ ));
+
+ $this->option('symfony', array(
+ 'form' => false,
+ 'filter' => false,
+ ));
+ }
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->hasOne('sfGuardUser as User', array(
+ 'local' => 'user_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $this->hasOne('sfGuardPermission as Permission', array(
+ 'local' => 'permission_id',
+ 'foreign' => 'id',
+ 'onDelete' => 'CASCADE'));
+
+ $timestampable0 = new Doctrine_Template_Timestampable(array(
+ ));
+ $this->actAs($timestampable0);
+ }
+}
View
15 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardForgotPassword.class.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * sfGuardForgotPassword
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+class sfGuardForgotPassword extends PluginsfGuardForgotPassword
+{
+}
View
19 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardForgotPasswordTable.class.php
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * sfGuardForgotPasswordTable
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ */
+class sfGuardForgotPasswordTable extends PluginsfGuardForgotPasswordTable
+{
+ /**
+ * Returns an instance of this class.
+ *
+ * @return object sfGuardForgotPasswordTable
+ */
+ public static function getInstance()
+ {
+ return Doctrine_Core::getTable('sfGuardForgotPassword');
+ }
+}
View
15 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroup.class.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * sfGuardGroup
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+class sfGuardGroup extends PluginsfGuardGroup
+{
+}
View
15 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroupPermission.class.php
@@ -0,0 +1,15 @@
+<?php
+
+/**
+ * sfGuardGroupPermission
+ *
+ * This class has been auto-generated by the Doctrine ORM Framework
+ *
+ * @package posting
+ * @subpackage model
+ * @author Your name here
+ * @version SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
+ */
+class sfGuardGroupPermission extends PluginsfGuardGroupPermission
+{
+}
View
19 lib/model/doctrine/sfDoctrineGuardPlugin/sfGuardGroupPermissionTable.class.php
@@ -0,0 +1,19 @@