Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
03ec20b
Moved direcotiress and renamed files for 2.0 readiness
predominant May 22, 2011
88aa69c
Moved Email elements to view directory
predominant May 22, 2011
a184f52
Moved UsersAppController and UsersAppModel.
predominant May 22, 2011
ab6bb77
Added App:uses for Security and Model for User model and tests,
predominant May 22, 2011
e984cb0
Updated readme to indicate CakePHP 2.0 required.
predominant May 22, 2011
6b58753
Change import() to uses()
predominant May 22, 2011
9b21233
Changed 'passwd' to 'password'!
predominant May 22, 2011
906f429
Changing translation usage, and minor reformatting of code,
predominant May 22, 2011
82a18ed
Updated use of translation strings for all Users views.
predominant May 22, 2011
557089c
Updated use of translation shortcuts in email views.
predominant May 22, 2011
f9eddb9
Change dtranslation shortcut usage for Details views for CakePHP 2.0
predominant May 22, 2011
75f9761
Changed translation shortcut usage in Controllers.
predominant May 22, 2011
7eb0b2d
Fix translation shortcuts in Models, and minor code adjustments.
predominant May 22, 2011
825b76d
Fix App:uses for Security class
predominant Jun 11, 2011
697800b
Added docblock
predominant Jun 11, 2011
9caf540
Fixed uses for Security class
predominant Jun 11, 2011
2c63af3
Added doc blocks and fixed plugin name in UserTest
predominant Jun 11, 2011
a991c1c
Behaviors now load only if their respective plugins are available.
predominant Jun 11, 2011
151a4f1
Fixed internal type checking on testGenerateToken
predominant Jun 11, 2011
42ee8b3
Fix internal type checking
predominant Jun 11, 2011
0628273
Fixed testValidateToken test find
predominant Jun 11, 2011
eebe8fa
Removing blank lines
predominant Jun 11, 2011
cf18c46
Changed App::import of Security to App::uses
predominant Jun 11, 2011
adf9fb8
Changed resetPassword to return a boolean
predominant Jun 11, 2011
713bb4a
Changed resetPassword usage to retain 2.0 returned data instead of bo…
predominant Jun 11, 2011
f96bde2
Fix docblock typo
predominant Jun 11, 2011
6c04c5c
Fix internal type check for checkPassword
predominant Jun 11, 2011
bf52305
Fix internal type check for resetPassword
predominant Jun 11, 2011
c2b526f
Restructure tests for easier debugging
predominant Jun 11, 2011
b813258
Fix implementation of validateOldPassword, error introduced when pass…
predominant Jun 11, 2011
667aa6f
Simplified validateOldPassword return
predominant Jun 11, 2011
9e6a91c
Remove empty lines
predominant Jun 11, 2011
59248f7
Removed search testing, should be tested in the search plugin.
predominant Jun 11, 2011
fd385c7
Fixed DetailTest so it passes
predominant Jun 15, 2011
65102fa
Adding App::uses() instead of App::import for reuqired classes
predominant Jun 15, 2011
6dbcf8f
Added dynamic loading of components and helpers based on availability.
predominant Jun 15, 2011
89a49b5
Separated Auth setup functionality.
predominant Jun 15, 2011
a5496a3
Fixed CakeRequest not being passed to UsersController in tests
predominant Jun 15, 2011
15c3cd3
Fixed request URL for 2.0, and changed to use startupProcess to initi…
predominant Jun 15, 2011
d49fca5
Changed fixtures to generic data. Made login tests pass. Commented se…
predominant Jun 15, 2011
0e39e64
Fixed failing tests due to Fixture changes
predominant Jun 15, 2011
86bd933
Removed loginError, its no longer used. Moved failed login test to a …
predominant Jun 15, 2011
69e5b8c
Fixed test for failed login
predominant Jun 15, 2011
b0ac4e1
Added doc block for new test
predominant Jun 15, 2011
833a0b6
Fixed Unit Tests for UsersController and UserTest (Wrong fixture data).
ajibarra Jun 17, 2011
a6672e3
Changed validateToken to include role
ajibarra Jun 24, 2011
da56b7c
Moved Details to UserDetails. Changed lots of fields like email_authe…
predominant Jun 26, 2011
8344375
Merge remote-tracking branch 'origin/develop' into 2.0
predominant Jun 26, 2011
fa1f05d
Fixed expiry field change, and moved paging element to avoid view mess
predominant Jun 26, 2011
80d3365
Minor html changes
predominant Jun 26, 2011
ddfadfd
Changed register action to add
predominant Jun 26, 2011
f86f440
Added class variable for Detail model instance.
predominant Nov 5, 2010
0b5ef3c
Renamed register() action to add()
predominant Nov 8, 2010
f99efdc
Cleanup user login form.
predominant Nov 8, 2010
5e378bd
Export openid to separate view. Fixed AND/OR Mix
predominant Jun 27, 2011
706a76c
Echo user add heading
predominant Jun 27, 2011
0592090
Move logout message to setFlash
predominant Jun 27, 2011
2528fed
Restructure userscontroller verify
predominant Jun 27, 2011
b6c56fb
Update comments
predominant Jun 27, 2011
d31ef3e
Made the tests accessible again by fixing the naming
Aug 1, 2011
f69abaf
fix directory name and migrations map for cakephp 2.0
neterslandreau Aug 2, 2011
fab4af6
Merge pull request #6 from neterslandreau/2.0
Aug 2, 2011
7b954e7
Changed start and ed test to setup and tesar down
predominant Aug 10, 2011
5e9c907
Fixed find for token validation
predominant Aug 10, 2011
02eeb8d
Fixed field name on user fixture
predominant Aug 10, 2011
e4d1be3
Fixed field name for last_action in users test
predominant Aug 10, 2011
cd84c2f
Brace spacing
predominant Aug 10, 2011
6fa33b4
Fix expires field name testing
predominant Aug 10, 2011
88712af
remove recursion for password resetting
predominant Aug 10, 2011
08453cd
Fixed email_authenticated field rename
predominant Aug 10, 2011
ad1e6b1
Fixed UserDetails association and fixture import
predominant Aug 10, 2011
714f83a
Added false retun from User::add when data is not saved
predominant Aug 10, 2011
5313613
Fixed Detail->UserDetail assocation on User
predominant Aug 10, 2011
6b2b0f0
Change Detail instance variable to UserDetail
predominant Aug 10, 2011
b2acdc0
Fixed construct (Added response parameter) Moved validations declarat…
ajibarra Aug 10, 2011
c0a2251
Changed passwd to password
predominant Aug 12, 2011
9635ef9
Fixing the validation array, fixing a few test cases
Aug 30, 2011
f234a5a
Fixing more test cases
Aug 30, 2011
878b83b
Updated to match the latest Migration schema file.
ReplicaObscura Sep 12, 2011
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class M49c3417a54874a9d276811502cedc421 extends CakeMigration {
public $migration = array(
'up' => array(
'create_table' => array(
'details' => array(
'user_details' => array(
'id' => array('type'=>'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary'),
'user_id' => array('type'=>'string', 'null' => false, 'default' => NULL, 'length' => 36),
'position' => array('type'=>'float', 'null' => false, 'default' => '1', 'length' => 4),
Expand All @@ -50,16 +50,16 @@ class M49c3417a54874a9d276811502cedc421 extends CakeMigration {
'id' => array('type'=>'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary'),
'username' => array('type'=>'string', 'null' => false, 'default' => NULL),
'slug' => array('type'=>'string', 'null' => false, 'default' => NULL),
'passwd' => array('type'=>'string', 'null' => true, 'default' => NULL, 'length' => 128),
'password' => array('type'=>'string', 'null' => true, 'default' => NULL, 'length' => 128),
'password_token' => array('type'=>'string', 'null' => true, 'default' => NULL, 'length' => 128),
'email' => array('type'=>'string', 'null' => true, 'default' => NULL),
'email_authenticated' => array('type'=>'boolean', 'null' => true, 'default' => '0'),
'email_verified' => array('type'=>'boolean', 'null' => true, 'default' => '0'),
'email_token' => array('type'=>'string', 'null' => true, 'default' => NULL),
'email_token_expires' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
'email_token_expiry' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
'tos' => array('type'=>'boolean', 'null' => true, 'default' => '0'),
'active' => array('type'=>'boolean', 'null' => true, 'default' => '0'),
'last_login' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
'last_activity' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
'last_action' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
'is_admin' => array('type'=>'boolean', 'null' => true, 'default' => '0'),
'role' => array('type'=>'string', 'null' => true, 'default' => NULL),
'created' => array('type'=>'datetime', 'null' => true, 'default' => NULL),
Expand All @@ -74,7 +74,7 @@ class M49c3417a54874a9d276811502cedc421 extends CakeMigration {
),
'down' => array(
'drop_table' => array(
'users', 'details'),
'users', 'user_details'),
)
);

Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions config/schema/users.php → Config/Schema/schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function before($event = array()) {
function after($event = array()) {
}

var $details = array(
var $user_details = array(
'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary'),
'user_id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36),
'position' => array('type' => 'float', 'null' => false, 'default' => '1'),
Expand All @@ -41,16 +41,16 @@ function after($event = array()) {
'id' => array('type' => 'string', 'null' => false, 'default' => NULL, 'length' => 36, 'key' => 'primary'),
'username' => array('type' => 'string', 'null' => false, 'default' => NULL, 'key' => 'index'),
'slug' => array('type' => 'string', 'null' => false, 'default' => NULL),
'passwd' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 128),
'password' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 128),
'password_token' => array('type' => 'string', 'null' => true, 'default' => NULL, 'length' => 128),
'email' => array('type' => 'string', 'null' => true, 'default' => NULL, 'key' => 'index'),
'email_authenticated' => array('type' => 'boolean', 'null' => true, 'default' => '0'),
'email_verified' => array('type' => 'boolean', 'null' => true, 'default' => '0'),
'email_token' => array('type' => 'string', 'null' => true, 'default' => NULL),
'email_token_expires' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'email_token_expiry' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'tos' => array('type' => 'boolean', 'null' => true, 'default' => '0'),
'active' => array('type' => 'boolean', 'null' => true, 'default' => '0'),
'last_login' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'last_activity' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'last_action' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
'is_admin' => array('type' => 'boolean', 'null' => true, 'default' => '0'),
'role' => array('type' => 'string', 'null' => true, 'default' => NULL),
'created' => array('type' => 'datetime', 'null' => true, 'default' => NULL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,22 @@
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/

App::uses('UsersAppController', 'Users.Controller');

/**
* Users Details Controller
*
* @package users
* @subpackage users.controllers
*/
class DetailsController extends UsersAppController {
class UserDetailsController extends UsersAppController {

/**
* Name
*
* @var string
*/
public $name = 'Details';
public $name = 'UserDetails';

/**
* Helpers
Expand Down Expand Up @@ -54,8 +56,8 @@ public function index() {
*/
public function view($id = null) {
if (!$id) {
$this->Session->setFlash(__d('users', 'Invalid Detail.', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Invalid Detail.'));
$this->redirect(array('action' => 'index'));
}
$this->set('detail', $this->Detail->read(null, $id));
}
Expand All @@ -76,7 +78,7 @@ public function add() {
array('Detail.user_id' => $userId, 'Detail.field' => $field));
}
}
$this->Session->setFlash(__d('users', 'Saved', true));
$this->Session->setFlash(__d('users', 'Saved'));
}
$this->redirect(array('action' => 'index'));
}
Expand All @@ -97,7 +99,7 @@ public function edit($section = 'user') {
if (!empty($this->data)) {
$this->Detail->saveSection($this->Auth->user('id'), $this->data, $section);
$this->data['Detail'] = $this->Detail->getSection($this->Auth->user('id'), $section);
$this->Session->setFlash(sprintf(__d('users', '%s details saved', true), ucfirst($section)));
$this->Session->setFlash(sprintf(__d('users', '%s details saved'), ucfirst($section)));
}

if (empty($this->data)) {
Expand All @@ -115,12 +117,12 @@ public function edit($section = 'user') {
*/
public function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__d('users', 'Invalid id for Detail', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Invalid id for Detail'));
$this->redirect(array('action' => 'index'));
}
if ($this->Detail->delete($id)) {
$this->Session->setFlash(__d('users', 'Detail deleted', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Detail deleted'));
$this->redirect(array('action' => 'index'));
}
}

Expand All @@ -142,8 +144,8 @@ public function admin_index() {
*/
public function admin_view($id = null) {
if (!$id) {
$this->Session->setFlash(__d('users', 'Invalid Detail.', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Invalid Detail.'));
$this->redirect(array('action' => 'index'));
}
$this->set('detail', $this->Detail->read(null, $id));
}
Expand All @@ -157,10 +159,10 @@ public function admin_add() {
if (!empty($this->data)) {
$this->Detail->create();
if ($this->Detail->save($this->data)) {
$this->Session->setFlash(__d('users', 'The Detail has been saved', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'The Detail has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__d('users', 'The Detail could not be saved. Please, try again.', true));
$this->Session->setFlash(__d('users', 'The Detail could not be saved. Please, try again.'));
}
}

Expand All @@ -176,15 +178,15 @@ public function admin_add() {
*/
public function admin_edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__d('users', 'Invalid Detail', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Invalid Detail'));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->Detail->save($this->data)) {
$this->Session->setFlash(__d('users', 'The Detail has been saved', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'The Detail has been saved'));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__d('users', 'The Detail could not be saved. Please, try again.', true));
$this->Session->setFlash(__d('users', 'The Detail could not be saved. Please, try again.'));
}
}
if (empty($this->data)) {
Expand All @@ -203,12 +205,12 @@ public function admin_edit($id = null) {
*/
public function admin_delete($id = null) {
if (!$id) {
$this->Session->setFlash(__d('users', 'Invalid id for Detail', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Invalid id for Detail'));
$this->redirect(array('action' => 'index'));
}
if ($this->Detail->delete($id)) {
$this->Session->setFlash(__d('users', 'Detail deleted', true));
$this->redirect(array('action'=>'index'));
$this->Session->setFlash(__d('users', 'Detail deleted'));
$this->redirect(array('action' => 'index'));
}
}
}
11 changes: 11 additions & 0 deletions users_app_controller.php → Controller/UsersAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@
* @subpackage users.controllers
*/
class UsersAppController extends AppController {

/**
* Default isAuthorized method
*
* This is called to see if a user (when logged in) is able to access an action
*
* @return boolean True if allowed
*/
public function isAuthorized() {
return true;
}
}
Loading