Feng Forum
Support => Getting Started => : metabyte June 09, 2009, 11:05:31 AM
-
Hi,
I would like to know if there is a config option or dev hack so that when I create users, there is no workspace automatically generated for them.
Thanks
-
Hi,
I think I just found where the modification is to be done: in the Controller.
Method A: Quick and Dirty Steps:
1) Edit file application/controllers/UserController.class.php
2) Got to line 221 and comment
//$project_user->save();
Method B: Configuration Driven (more elegant?):
1) Add to mysql table "og_config_options", assuming "og: your table prefix, the following:
INSERT INTO `eznetflow_config_options` VALUES ('', 'general', 'automatic_personal_workspace_generation', '0', 'BoolConfigHandler', '0', '0', 'Enable automatic personal user workspace creation');
2) Edit file application/controllers/UserController.class.php
3) Replace
/* create personal project */
$project = new Project();
by
/* create personal project */
if (config_option('automatic_personal_workspace_generation')) {
$project = new Project();
4) Replace
$project_user->save();
/* end personal project */
by
$project_user->save();
}
/* end personal project */
5) Update language files. For english, edit file language/en_us/administration.php and replace
// General
'config option name site_name' => 'Site name',
by
// General
'config option name automatic_personal_workspace_generation' => 'Enable automatic users personal workspace generation',
'config option name site_name' => 'Site name',
Now, you can go to the Administration and configure if you wish to automatically generate user workspaces when you add them.
Now, I may probaby check what happens when we delet a user... TBC
-
One last thing to do in Method B:
Replace in application/controllers/UserController.class.php, around line 250
// End: update contact info if user was created from a contact
DB::commit();
if (logged_user()->isProjectUser($new_project)) {
evt_add("workspace added", array(
"id" => $new_project->getId(),
"name" => $new_project->getName(),
"color" => $new_project->getColor()
));
}
by
// End: update contact info if user was created from a contact
DB::commit();
if (config_option('automatic_personal_workspace_generation')) {
if (logged_user()->isProjectUser($new_project)) {
evt_add("workspace added", array(
"id" => $new_project->getId(),
"name" => $new_project->getName(),
"color" => $new_project->getColor()
));
}
}
-
Hi, on version 1.5 you will be able to select the user's Personal workspace from an existing one or automatically create one.