gRbac - User registration, authentication and management

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));

  }

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

Wish the best for this great extension!

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',

	),



Thanks

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.

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

grbac is jointly owned by Ricardo and Deepak at http://code.google.com/p/grbac/

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

I have no BaseController.php anywhere, where is that from?

Thanks

Hi, I have the same question…

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, tresero, it works :slight_smile:

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.

Thanks man.

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.

Thanks for sharing tresero - found it useful