Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New feature: New authentication method management
Dev: Updating DB: grant auth_db permission to every existing user
- Loading branch information
Showing
3 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1266,7 +1266,37 @@ function db_upgrade_all($iOldDBVersion) { | |
alterColumn('{{participants}}', 'lastname', "string(150)", false); | ||
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>179),"stg_name='DBVersion'"); | ||
} | ||
if ($iOldDBVersion < 180) | ||
{ | ||
$aUsers = User::model()->findAll(); | ||
$aPerm = array( | ||
'entity_id' => 0, | ||
'entity' => 'global', | ||
'uid' => 0, | ||
'permission' => 'auth_db', | ||
'create_p' => 0, | ||
'read_p' => 1, | ||
'update_p' => 0, | ||
'delete_p' => 0, | ||
'import_p' => 0, | ||
'export_p' => 0 | ||
); | ||
|
||
foreach ($aUsers as $oUser) | ||
{ | ||
if (!Permission::model()->hasGlobalPermission('auth_db','read',$oUser->uid)) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Aestu
Author
Collaborator
|
||
{ | ||
$oPermission = new Permission; | ||
foreach ($aPerm as $k => $v) | ||
{ | ||
$oPermission->$k = $v; | ||
} | ||
$oPermission->uid = $oUser->uid; | ||
$oPermission->save(); | ||
} | ||
} | ||
$oDB->createCommand()->update('{{settings_global}}',array('stg_value'=>180),"stg_name='DBVersion'"); | ||
} | ||
$oTransaction->commit(); | ||
// Activate schema caching | ||
$oDB->schemaCachingDuration=3600; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 comment
on commit 32377e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks \o/
Test if is_null ? Then if it set but to 0 : adding it ?