MoroGasper / yii-usergroups

Automatically exported from code.google.com/p/yii-usergroups
0 stars 0 forks source link

Wrong module field values for controllers inside modules #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Create an Yii web application
2.Install userGroups module
3.Access the Root Tools and check the modules list in the permissions
4.Define a new user or group and assign it permissions on the userGroups 
module/controller

What is the expected output? What do you see instead?
The controllers defined inside modules should have the module field correctly 
defined.
Whe controllers are defined inside modules the module field has the filesystem 
path for the controller
(EX: 
D:\Apps\xampp\htdocs\test\protected\modules\userGroups\controllers/AdminControll
er.php instead of userGroups)

What version of the product are you using? On what operating system?
Yii 1.1.7
userGroups 1.6.3
Windows 7 Enterprise 64bits

Please provide any additional information below.
I believe the available modules are not correctly loaded maybe because of 
directory separator in windows is \ and linux is /
If checking the database the entries for those permissions are saved but we bad 
values (filesystem path)
In userGroups/model/UserGroupsAccess.php if i change the line 167 from 
                    self::$_moduleName = preg_replace('/^.*\/modules\/(.*)\/controllers.*$/', '$1', $controller);
to 

                if (DIRECTORY_SEPARATOR == '/') 
                    self::$_moduleName = preg_replace('/^.*\/modules\/(.*)\/controllers.*$/', '$1', $controller);
                else
                    self::$_moduleName = preg_replace('/^.*\\\modules\\\(.*)\\\controllers.*$/', '$1', $controller);
it works fine

Original issue reported on code.google.com by artur.ol...@gmail.com on 19 Apr 2011 at 8:52

GoogleCodeExporter commented 8 years ago
started working on it

Original comment by nic...@creationgears.com on 20 Apr 2011 at 1:25

GoogleCodeExporter commented 8 years ago
fixed, thanks a lot!

Original comment by nic...@creationgears.com on 20 Apr 2011 at 2:01