foe_1
(foe#1)
December 24, 2009, 9:25pm
21
Locke:
Little Bug
In grbac/controllers/AdminController.php :
public function actionManage() {
$actives = Users::model()->count('active=1');
$inactives = Users::model()->count('active=0');
$this->render('manage', array('users'=>$users,'actives'=>$actives,'inactives'=>$inactives));
}
Thus $users isn’t defined and we get error , so i changed it to this and now it’s working .
Probably we don’t need all the data from Users and should use CDbCriteria , it’s just a quick fix.
public function actionManage() {
$actives = Users::model()->count('active=1');
$inactives = Users::model()->count('active=0');
$users= Users::model()->findAll();
$this->render('manage', array('users'=>$users,'actives'=>$actives,'inactives'=>$inactives));
}
i’m off to check emailing capabilities
Thanks man for helping me test this module. Incrementally we can make this useful.
The manage screen does not need the data object users. I will change the call to render and omit the parameter ‘users’
In grbac/controllers/AdminController.php :
public function actionManage() {
$actives = Users::model()->count('active=1');
$inactives = Users::model()->count('active=0');
$this->render('manage', array('actives'=>$actives,'inactives'=>$inactives));
}
foe_1
(foe#1)
December 24, 2009, 9:58pm
22
robregonm:
I’ve tested your extension and I think that some “tableName” functions in some models should be modified to detect automatically the tablename from srbac configuration or maybe should be inherited from main Users model and only this model implements this code. Also, I think i18n for this ext will be very useful.
I can give you a hand, I like this extension very much, contact me and maybe we implement a SVN (e.g. Google Code) and it will e easier to modify and maintain. (I’m testing with Yii 1.1-dev and Srbac 1.1-dev)
Best regards and merry christmas.
Hi Robregonm,
Merry Christmas and Happy New Year.
I sure do accept and appreciate your help. I have no clue with i18n and this will give me opportunity to learn.
Dearest,
I have a problem shown in the attached result.jpg. I spent more time and couldn’t solve it.
What I can do to to solve it ? Thank much !
My config file is main.php (as the attachment). And in srbac_install.jpg file you can see what versions I used and the srbac installation.
All the Best,
Tzu-han Travor KAO
yiimann
(Contact)
December 26, 2009, 5:56pm
24
Wish the best for this great extension!
foe_1
(foe#1)
December 26, 2009, 8:30pm
25
Dearest,
I have a problem shown in the attached result.jpg. I spent more time and couldn’t solve it.
What I can do to to solve it ? Thank much !
My config file is main.php (as the attachment). And in srbac_install.jpg file you can see what versions I used and the srbac installation.
All the Best,
Tzu-han Travor KAO
Hi Tzu-han,
Looks like you are missing the BaseController.php in /protected/components
If that file is there, please check to see if your config file includes it.
My import looks like this!
// autoloading model and component classes
,'import'=>array(
'application.models.*',
'application.components.*',
'application.modules.grbac.models.Users',
'application.modules.srbac.models.Assignments',
'application.modules.srbac.controllers.SBaseController',
),
Onman
(O Rijkers)
December 27, 2009, 2:59am
27
I’ve read all the positive reactions in this post.
However, when i tried to download and open the grbac.zip from the extensions repository, Winzip pops up an error saying it can’t open the file.
Can I get the file at some other place?
Update (27-12-2009):
It looks like the zip-file is not completely downloaded. In the repository it shows a size of 941.9Kb, but when I download it it downloads only 806Kb.
I’m using IE7.
Anyone any idea what the problem can be? Or if I can download the file from another location to see if that works fine (I’ve never had this problem before on other files).
foe_1
(foe#1)
January 4, 2010, 9:18pm
28
Onman:
I’ve read all the positive reactions in this post.
However, when i tried to download and open the grbac.zip from the extensions repository, Winzip pops up an error saying it can’t open the file.
Can I get the file at some other place?
Update (27-12-2009):
It looks like the zip-file is not completely downloaded. In the repository it shows a size of 941.9Kb, but when I download it it downloads only 806Kb.
I’m using IE7.
Anyone any idea what the problem can be? Or if I can download the file from another location to see if that works fine (I’ve never had this problem before on other files).
Downloaded OK let me know if any one else have the same problem.
Onman
(O Rijkers)
January 4, 2010, 9:32pm
29
I’ve recently installed FF. With FF it downloads ok.
IE 7 (still) does not download the whole file (although it thinks it does).
But at least now I can explore your development results.
Onman:
I’ve recently installed FF. With FF it downloads ok.
IE 7 (still) does not download the whole file (although it thinks it does).
But at least now I can explore your development results.
Yet another hidden feature in IE7!
doodle
foe_1
(foe#1)
January 13, 2010, 1:19am
31
grbac is jointly owned by Ricardo and Deepak at http://code.google.com/p/grbac/
isidro
(Isidro)
January 14, 2010, 10:42pm
32
I there! I’ve just installed and after a little “keyboard stroke fight” I’ve managed to get everything working.
But I have a really special request to do. I would like to add a few more fields to the registration form and I’m quite lost. I would like to add a foreign key to another table (Language). I can do it using Yii’s standard way, but inside the component I’m a little lost. Where should I put the relations() method? In the Users class or in the RegisterForm class? Do I have to add properties in these classes (languageId) or just the relations. I’ve tried everything I could come up with but with no success.
Oh and by the way my relations would be a one-to-many (User have one Language; a Language as many Users).
I’m hopping to read from you very soon.
Congratuations for the good work.
Best regards,
Isidro
tresero
(Jongriffinjr)
January 23, 2010, 10:09pm
33
I have no BaseController.php anywhere, where is that from?
Thanks
arsaa
(Arsaa)
January 24, 2010, 2:40pm
34
Hi, I have the same question…
tresero
(Jongriffinjr)
January 24, 2010, 5:47pm
35
arsaa,
You need to create it in protected/components/BaseController.php
Here is what my BaseController.php looks like. I am not sure if there should be anything else or not, I just made this one.
<?php
class BaseController extends CController {
public $pageDescription = null; //Default
public $pageKeywords = null; //Default
public $metaRobots = null; //Default
.
public function grbac_crypt($algo,$password,$salt) {
if (!function_exists('hash')) {
$cypted = md5($password.$salt);
}
else {
$cypted = hash($algo, $password.$salt);
}
return $cypted;
}
public function grbac_sendEmail($to, $subject, $emailText) {
if ($this->module->useEmailExtension == 'mailer') {
$mailer = Yii::createComponent('application.extensions.mailer.EMailer');
// Configure your mailer here
//--------------------------
// see: http://www.yiiframework.com/extension/mailer/
$mailer->CharSet = 'UTF-8';
$mailer->IsHTML(true);
$mailer->From = Yii::app()->getModule('grbac')->emailFrom;
$mailer->AddAddress($to);
$mailer->Subject = $subject;
$mailer->Body = $emailText;
$mailer->Send();
} else {
// Test mode: if not set, display content on screen
print_r($emailText);
}
}
}//class
?>
arsaa
(Arsaa)
January 25, 2010, 7:19am
36
Thanks, tresero, it works
Found a bug…
Line 44 in PasswordController should be
$this->render('forgot',array('form'=>$user));
Currently it is
$this->render('forgot',array('form'=>$form));
and hence throws errors.
A small easily missed bug,
IN the actionRegister while building the confirmation url sent in mail, you are using
Yii::app()->getRequest()->getBaseUrl() , which results in wrong URL when the app is hosted not in root directory but in separate directory. Instead, using Yii::app()->request->hostInfo gives out correct output URL.
n a minor typo bug, in the registration_confirm,register_success views Registration is spelled as ‘Registeration’ in the titles.
Seal
(Sealtrip)
February 9, 2010, 10:37am
40
tresero:
arsaa,
You need to create it in protected/components/BaseController.php
Here is what my BaseController.php looks like. I am not sure if there should be anything else or not, I just made this one.
<?php
class BaseController extends CController {
public $pageDescription = null; //Default
public $pageKeywords = null; //Default
public $metaRobots = null; //Default
.
public function grbac_crypt($algo,$password,$salt) {
if (!function_exists('hash')) {
$cypted = md5($password.$salt);
}
else {
$cypted = hash($algo, $password.$salt);
}
return $cypted;
}
public function grbac_sendEmail($to, $subject, $emailText) {
if ($this->module->useEmailExtension == 'mailer') {
$mailer = Yii::createComponent('application.extensions.mailer.EMailer');
// Configure your mailer here
//--------------------------
// see: http://www.yiiframework.com/extension/mailer/
$mailer->CharSet = 'UTF-8';
$mailer->IsHTML(true);
$mailer->From = Yii::app()->getModule('grbac')->emailFrom;
$mailer->AddAddress($to);
$mailer->Subject = $subject;
$mailer->Body = $emailText;
$mailer->Send();
} else {
// Test mode: if not set, display content on screen
print_r($emailText);
}
}
}//class
?>
Thanks for sharing tresero - found it useful