Yii Framework Forum: [Module] Yii User Management Module - Yii Framework Forum

Jump to content

  • (30 Pages)
  • +
  • « First
  • 23
  • 24
  • 25
  • 26
  • 27
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

[Module] Yii User Management Module Discussion, Bug Reports and Feature Requests for the User Management Rate Topic: ***** 5 Votes

#481 User is offline   Saru 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 16-July 12

Posted 26 July 2012 - 11:27 PM

View Postselorm, on 25 July 2012 - 08:11 PM, said:

Just add public $usergroupTable = 'user_group' to usergroupModule.
I added an issue on github(check it out) it worked for me..

Thanks for reply.

After making change I got another error The table "{{usergroup}}" for active record class "YumUsergroup" cannot be found in the database.
Saru
www.Saruinfo.com PHP-Freelancer
0

#482 User is offline   selorm 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 16-July 12

Posted 27 July 2012 - 05:13 AM

View PostSaru, on 26 July 2012 - 11:27 PM, said:

Thanks for reply.

After making change I got another error The table "{{usergroup}}" for active record class "YumUsergroup" cannot be found in the database.


Ok...change line 17 of YumUsergroup, thus{{usergroup}} to {{user_group}} and u might also get similar errors for {{usergroup_messages}} not found in the database-->Fix this by changing line 11 of YumUsergroupMessages to
{{user_group_message}}...Hope this helps
0

#483 User is offline   Workino 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 25-July 12

Posted 02 August 2012 - 04:48 AM

Hello,
i got this problem on registration process.

any help will be appreciate

 Trying to get property of non-object

/var/www/yii/xxxxx/protected/modules/registration/controllers/YumRegistrationController.php(23)

11 Yii::import('application.modules.profile.models.*');
12 Yii::import('application.modules.registration.models.*');
13 
14 class YumRegistrationController extends YumController {
15     public $defaultAction = 'registration';
16 
17     // Only allow the registration if the user is not already logged in and
18     // the function is activated in the Module Configuration
19     public function beforeAction($action) {
20         if (!Yii::app()->user->isGuest) 
21             $this->redirect(Yii::app()->user->returnUrl);
22 
23         $this->layout = Yum::module('registration')->layout;
24         return parent::beforeAction($action);
25     }
26 
27     public function accessRules() {
28         return array(
29                 array('allow',
30                     'actions' => array('index', 'registration', 'recovery', 'activation', 'resendactivation'),
31                     'users' => array('*'),
32                     ),
33                 array('allow',
34                     'actions' => array('captcha'),
35                     'users' => array('*'),



SOLVED:
need to add 'registration' => array(), in config/main.php and point my browser to r=registration/registration
0

#484 User is offline   Michel Kogan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 28-February 11

Posted 18 August 2012 - 01:09 PM

when I try to login using this extension ( after installtion using /user/install ), i got following error:
 Fatal error: Call to a member function get() on a non-object in /Library/WebServer/Documents/yum/yum/protected/modules/user/models/YumUser.php on line 381


my config file:
<?php
return array(
    'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
    'name' => 'My Web Application',
    // preloading 'log' component
    'preload' => array( 'log' ),
    // autoloading model and component classes
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.modules.user.models.*',
    ),
    'modules' => array(
        // uncomment the following to enable the Gii tool

        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'Enter Your Password Here',
            // If removed, Gii defaults to localhost only. Edit carefully to taste.
            'ipFilters' => array( '127.0.0.1', '::1' ),
        ),
        'user' => array(
            'debug' => false
        )
    ),
    // application components
    'components' => array(
        'user' => array(
            'class' => 'application.modules.user.components.YumWebUser',
            // enable cookie-based authentication
            'allowAutoLogin' => true,
            'loginUrl' => array( '//user/user/login' )
        ),
        // uncomment the following to enable URLs in path-format

        'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => array(
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),
        /* 'db' => array(
          'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
          ), */
        // uncomment the following to use a MySQL database

        'db' => array(
            'connectionString' => 'mysql:host=localhost;dbname=yum',
            'emulatePrepare' => true,
            'username' => 'root',
            'password' => 'root',
            'charset' => 'utf8',
        ),
        'errorHandler' => array(
            // use 'site/error' action to display errors
            'errorAction' => 'site/error',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, warning',
                ),
            // uncomment the following to show log messages on web pages
            /*
              array(
              'class'=>'CWebLogRoute',
              ),
             */
            ),
        ),
    ),
    // application-level parameters that can be accessed
    // using Yii::app()->params['paramName']
    'params' => array(
        // this is used in contact page
        'adminEmail' => 'webmaster@example.com',
    ),
);


my module folder instruction:

modules
|_avatar
|_firendship
|_membership
|_message
|_profile
|_registration
|_role
|_user
|_usergroup
|_README.md

-------------------------------

solved! thanks to this thread
0

#485 User is offline   Michel Kogan 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 28-February 11

Posted 22 August 2012 - 02:59 PM

I'm trying to extend YumRegistrationController and I followed this post.

but what's the url to access my new overridden actionRegistration in my main protected/controllers folder ?

index.php?r=registration/registration/registration redirects me to the same result as in example registrationAction returns instead new overridden actionRegistration.

______

solved by adding this to modules in config.php

'registration' => array(
            'enableRegistration' => true,
            'enableCaptcha' => true,
            'registrationView' => 'application.views.registration.registration',
            'controllerMap' => array(
                'registration' => array(
                    'class' => 'application.controllers.RegistrationController' ),
            ),
        ),


and in render part of RegistrationController :

$this->render('application.views.registration.registration', array( 'profile' => $profile ));

1

#486 User is offline   liam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 01-September 12

Posted 03 September 2012 - 03:59 AM

Having installed yii-user-management 0.8rc6 successfully, all pages can be accessed except the following. My xampp version is 1.8.0 with PHP Version 5.4.4

1. User->Create new user>
2. Roles / Access control->Create new role
3. Roles / Access control->Grant permission

The above pages has the following errors when accessed.

( ! ) SCREAM: Error suppression ignored for
( ! ) Fatal error: Cannot re-assign auto-global variable _POST in E:\xampp\htdocs\clinic\protected\modules\user\components\Relation.php on line 723
Call Stack
# Time Memory Function Location
1 0.0011 138360 {main}( ) ..\index.php:0
2 0.0462 1082712 CApplication->run( ) ..\index.php:14
3 0.0463 1082808 CWebApplication->processRequest( ) ..\CApplication.php:162
4 0.0536 1228928 CWebApplication->runController( ) ..\CWebApplication.php:142
5 0.0703 1647192 CController->run( ) ..\CWebApplication.php:283
6 1.2091 3472032 CController->runActionWithFilters( ) ..\CController.php:266
7 1.2122 3523128 CFilterChain->run( ) ..\CController.php:292
8 1.2125 3524128 CInlineFilter->filter( ) ..\CFilterChain.php:131
9 1.2125 3524216 CController->filterAccessControl( ) ..\CInlineFilter.php:59
10 1.2147 3580640 CFilter->filter( ) ..\CController.php:1146
11 1.2151 3581472 CFilterChain->run( ) ..\CFilter.php:41
12 1.2152 3581472 CController->runAction( ) ..\CFilterChain.php:134
13 1.2642 3695056 CInlineAction->runWithParams( ) ..\CController.php:309
14 1.2643 3695392 YumUserController->actionCreate( ) ..\CInlineAction.php:50
15 1.3622 4039680 CController->render( ) ..\YumUserController.php:231
16 1.3622 4039808 CController->renderPartial( ) ..\CController.php:783
17 1.3632 4040600 CBaseController->renderFile( ) ..\CController.php:870
18 1.3633 4040776 CBaseController->renderInternal( ) ..\CBaseController.php:96
19 1.3639 4060904 require( 'E:\xampp\htdocs\clinic\protected\modules\user\views\user\create.php' ) ..\CBaseController.php:127
20 1.3836 4066680 CController->renderPartial( ) ..\create.php:10
21 1.3843 4066888 CBaseController->renderFile( ) ..\CController.php:870
22 1.3843 4066952 CBaseController->renderInternal( ) ..\CBaseController.php:96
23 1.3854 4098680 require( 'E:\xampp\htdocs\clinic\protected\modules\user\views\user\_form.php' ) ..\CBaseController.php:127
24 1.6932 4830184 CBaseController->widget( ) ..\_form.php:44
25 1.6932 4830272 CBaseController->createWidget( ) ..\CBaseController.php:173
26 1.6932 4830272 CWidgetFactory->createWidget( ) ..\CBaseController.php:147
27 1.6932 4830304 YiiBase::import( ) ..\CWidgetFactory.php:147

---------------------------------------------------------------------------------------
4. Text translations

with the following errors

PHP error

Declaration of YumTranslationController::performAjaxValidation() should be compatible with YumController::performAjaxValidation($model, $form)

E:\xampp\htdocs\clinic\protected\modules\user\controllers\YumTranslationController.php(4)

01 <?php
02
03 class YumTranslationController extends YumController
04 {
05 public function filters()
06 {
07 return array(
08 'accessControl', // perform access control for CRUD operations
09 );
10 }
11
12 public function accessRules()
13 {
14 return array(
15 array('allow',
16 'actions'=>array('create','update', 'admin', 'delete'),
Stack Trace
#0
+ E:\xampp\htdocs\clinic\framework\YiiBase.php(316): require("E:\xampp\htdocs\clinic\protected\modules\user\controllers\YumTra...")
#1
+ E:\xampp\htdocs\clinic\framework\YiiBase.php(198): YiiBase::import("YumModule.controllers.YumTranslationController", true)
#2
+ E:\xampp\htdocs\clinic\framework\web\CWebApplication.php(333): YiiBase::createComponent(array("class" => "YumModule.controllers.YumTranslationController"), "translation", UserModule)
#3
+ E:\xampp\htdocs\clinic\framework\web\CWebApplication.php(339): CWebApplication->createController("translation/admin/", UserModule)
#4
+ E:\xampp\htdocs\clinic\framework\web\CWebApplication.php(277): CWebApplication->createController("user/translation/admin")
#5
+ E:\xampp\htdocs\clinic\framework\web\CWebApplication.php(142): CWebApplication->runController("user/translation/admin")
#6
+ E:\xampp\htdocs\clinic\framework\base\CApplication.php(162): CWebApplication->processRequest()
#7
– E:\xampp\htdocs\clinic\index.php(14): CApplication->run()
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 // specify how many levels of call stack should be shown in each log message
11 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
12
13 require_once($yii);
14 Yii::createWebApplication($config)->run();




Does anyone has idea what is going wrong with these pages ?
0

#487 User is offline   liam 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 01-September 12

Posted 04 September 2012 - 09:29 AM

Hi thyseus,

Just did a research on the web about the error of "Fatal error: Cannot re-assign auto-global variable _POST in E:\xampp\htdocs\clinic\protected\modules\user\components\Relation.php on line 723".

It seems that the code is incompatible with PHP 5.4+. I dunno whether my understanding is correct or not as I am a newbie in PHP and Yii. Do you have any advice to tackle the issue ? Thanks in advance.

Cheers,
liam
0

#488 User is offline   Martyn 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 12-September 12

Posted 13 September 2012 - 05:18 AM

Hi,

I am having issues with allowing guests to view profiles.

When I remove
array('deny',  // deny all users
				'users'=>array('*'),
			),

The profile view only sources the
 <div id="profile">.... </div>

and there is getFriends() on a non-object error


I changed profileModule
$profilesViewableByGuests = true;


I assumed (perhaps naively) the above was part of the functionality?
0

#489 User is offline   Jedyny 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 22-September 12

Posted 22 September 2012 - 04:27 PM

Hey guys.

I'm having a problem with login when using yum and shop module.
What I did is I install shop module. After few tweaks it was mostly working.
I also install a yum "user" module.
As a next step I wanted to split a front and backend part of shop module using this approach http://www.yiiframework.com/wiki/63/. For start I copied content of shop module /controllers to /controllers/back and /controllers/front, so for now back and front end will have the same functionality.
Then I open two windows (on two different browsers):
1. with backend - dummy.com/myshop/backend/shop/products/index
2. with frontend - dummy.com/myshop/shop/products/index

When I login at (2) it shows me an admin panel - thats great, but I want to move whole administrative part to /backend.
When I login at (1) it shows me that I'm logged in as a guest (isGuest: 1 loggedInAs: Guest) no matter what I will do. It's like when I'm on the backend side it does not store any info about logged user.

Please, If anyone of you have any hits, tips, whatever let me know. I already lost lot of time on this - with no luck. Tell me if you need to see some code.
0

#490 User is offline   Jedyny 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 22-September 12

Posted 26 September 2012 - 05:44 PM

Really guys.. nothing? I just need a clue.
I also tried with user module http://www.yiiframew...ension/yii-user
I have the same issue. After loggin in and going to my backend it does not shows that I'm logged in.
Please help.
0

#491 User is offline   air_cooled 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 11-September 12
  • Location:Australia

Posted 01 October 2012 - 06:04 AM

Apologies for the basic level problem, I've got Yum installed and it seems to mostly work.
I am concentrating on minor interactions until I get some more understanding, but I'm frustrated by this kind of thing at every turn.

I want to get a property from a users profile 'company_id'

I've built a basic interface to show this and added to the controller:

public function actionTest()
{
$company=YumProfile::model()->findByPk(yii::app()->User->id)->profile->company_id;

$this->render('test',array(
'company'=>$company,
));
}

All I get is this:

include(YumProfile.php): failed to open stream: No such file or directory

I'm not sure if this is really the issue or the consequence of the issue. The profile page in the user admin (sort-of) works. I can't add fields via the interface, but carefully adding them manually seems to work.

So I don't know if this is a path problem, does it really need YumProfile.php? Or is it just something else I've screwed up?

If there is some more comprehesive doco for this extension I'm happy to read, but I can't find them.

Any pointers on the above issue?
thanks
Every complex problem has a simple solution that is wrong.
0

#492 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 01 October 2012 - 06:13 AM

Try to import the YumProfile.php with

Yii::import('application.modules.profile.models.YumProfile');

or add

'application.modules.profile.models.*'

to your config/main.php 'import' section.

the docs in the modules/user/docs/ directory is the available documentation.
its not complete tough, and many features are not yet documented.
since yii-user-management is still quite active on github, any help in
form of translation or documentation is appreciated.
0

#493 User is offline   Vendict 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 01-February 11

Posted 09 October 2012 - 04:45 PM

View PostDG Esteban A. Pérez, on 23 September 2011 - 04:01 PM, said:

I'm using themes for my development design and i've encoutered this issue: YUM assumes that path for views are located in "application.views.etc". How can i tell YUM to use development's layout in use?

I clue is: Yii::app()->theme->baseUrl.'views.layouts.main, but is not a good idea to modify the modules code...


no, the right way is:
'user' => array(
			'allowAutoLogin'=>true,
			'loginUrl' => array('//user/user/login'),
			'debug' => false,
			'userTable' => 'user',
			'translationTable' => 'translation',
			'baseLayout'=>'//layouts/main',   /// THIS FOR THEMING
		),


in config file for theming this module.
It's works for me.
0

#494 User is offline   Akif 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 19-October 12

Posted 31 October 2012 - 04:32 AM

I have a problem can someone give me some hints about this error to solve my problem??
Fatal error: Call to a member function saveAs() on a non-object in D:\wamp\www\blog\protected\controllers\ProgramController.php on line 79
here is the function.
public function actionCreate()
	{
		$model=new Program;

		if(isset($_POST['Program']))
		{
			$model->attributes=$_POST['Program'];
                        $uploadedFile=CUploadedFile::getInstance($model,'image');
                        $fileName = rand(0,9999).$uploadedFile;
                        $model->cover_photo = $fileName;
                        
			if($model->save())
                        {
                                $uploadedFile->saveAs('banner/'.$fileName);  
				$this->redirect(array('view','id'=>$model->id));
                        }
		}

		$this->render('create',array(
			'model'=>$model,
		));
	}

0

#495 User is offline   Rats 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 12-October 12

Posted 07 November 2012 - 06:21 AM

View Postsravani, on 25 January 2011 - 04:27 AM, said:

After setting up the extension I am getting this issue....
Alias "user.UserModule" is invalid. Make sure it points to an existing PHP file.



For interest of others, I am posting this because i was also having same issue about UserModule.php. After some research i found out this is not because of module code but because of my php.ini settings.

So for ppl who face this problem it's worth checking this. here is the solution in your php.ini file.

short_open_tag = On


I was not able to get the solution to this problem anywhere in the forum to replying to this thread

Thanks!
0

#496 User is offline   VapidWorx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-November 12

Posted 30 November 2012 - 09:21 PM

I'm trying to install the module and when I go to the install page this is what I get

'', 'ldap_port' => '', 'ldap_basedn' => '', 'ldap_protocol' => '', 'ldap_autocreate' => '', 'ldap_tls' => '', 'ldap_transfer_attr' => '', 'ldap_transfer_pw' => ''); private $_urls=array( 'login'=>array('//user/user'), 'return'=>array('//user/user/index'), 'firstVisit'=>array('//user/privacy/update'), 'delete'=>array('//user/user/delete'), // Page to go after admin logs in 'returnAdmin'=>false, // Page to go to after logout 'returnLogout'=>array('//user/user/login')); private $_views = array( 'login' => '/user/login', 'menu' => '/user/menu', 'registration' => '/registration/registration', 'activate' => '/user/resend_activation', 'message' => '/user/message', 'passwordForm' => '/user/_activation_passwordform', 'messageCompose' =>'application.modules.message.views.message.compose'); // LoginType : // If you want to activate many types of login just sum up the values below and assign them to 'loginType' in // the user module configuration. const LOGIN_BY_USERNAME = 1; const LOGIN_BY_EMAIL = 2; const LOGIN_BY_OPENID = 4; const LOGIN_BY_FACEBOOK = 8; const LOGIN_BY_TWITTER = 16; const LOGIN_BY_LDAP = 32; // Allow login only by username by default. public $loginType = 1; /** * Defines all Controllers of the User Management Module and maps them to * shorter terms for using in the url * @var array */ public $controllerMap=array( 'default'=>array('class'=>'YumModule.controllers.YumDefaultController'), 'rest'=>array('class'=>'YumModule.controllers.YumRestController'), 'csv'=>array('class'=>'YumModule.controllers.YumCsvController'), 'auth'=>array('class'=>'YumModule.controllers.YumAuthController'), 'install'=>array('class'=>'YumModule.controllers.YumInstallController'), 'statistics'=>array('class'=>'YumModule.controllers.YumStatisticsController'), 'translation'=>array('class'=>'YumModule.controllers.YumTranslationController'), 'user'=>array('class'=>'YumModule.controllers.YumUserController'), // workaround to allow the url application/user/login: 'login'=>array('class'=>'YumModule.controllers.YumUserController') ); // Table names private $_tables = array( 'user' => 'user', 'privacySetting' => 'privacysetting', 'translation' => 'translation', 'message' => 'message', 'usergroup' => 'user_group', 'usergroupMessage' => 'user_group_message', 'profile' => 'profile', 'profileComment' => 'profile_comment', 'profileVisit' => 'profile_visit', 'profileField' => 'profile_field', 'role' => 'role', 'userRole' => 'user_role', 'membership' => 'membership', 'payment' => 'payment', 'friendship' => 'friendship', 'permission' => 'permission', 'action' => 'action', ); public $passwordRequirements = array( 'minLen' => 6, 'maxLen' => 128, 'minLowerCase' => 0, 'minUpperCase'=>0, 'minDigits' => 0, 'maxRepetition' => 3, ); public $usernameRequirements=array( 'minLen'=>3, 'maxLen'=>30, 'match' => '/^[A-Za-z0-9_]+$/u', 'dontMatchMessage' => 'Incorrect symbol\'s. (A-z0-9)', ); /** * Implements support for getting URLs, Tables and Views * @param string $name */ public function __get($name) { if(substr($name, -3) === 'Url') if(isset($this->_urls[substr($name, 0, -3)])) return $this->_urls[substr($name, 0, -3)]; if(substr($name, -4) === 'View') if(isset($this->_views[substr($name, 0, -4)])) return $this->_views[substr($name, 0, -4)]; if(substr($name, -5) === 'Table') if(isset($this->_tables[substr($name, 0, -5)])) return $this->_tables[substr($name, 0, -5)]; return parent::__get($name); } /** * Implements support for setting URLs and Views * @param string $name * @param mixed $value */ public function __set($name,$value) { if(substr($name,-3)==='Url') { if(isset($this->_urls[substr($name,0,-3)])) $this->_urls[substr($name,0,-3)]=$value; } if(substr($name,-4)==='View') { if(isset($this->_views[substr($name,0,-4)])) $this->_views[substr($name,0,-4)]=$value; } if(substr($name,-5)==='Table') { if(isset($this->_tables[substr($name,0,-5)])) $this->_tables[substr($name,0,-5)]=$value; } //parent::__set($name,$value); } public function init() { $this->setImport(array( 'YumModule.controllers.*', 'YumModule.models.*', 'YumModule.components.*', 'YumModule.core.*', )); } public function beforeControllerAction($controller, $action) { // Do not enable Debug mode when in Production Mode if(!defined('YII_DEBUG')) $this->debug = false; if(method_exists(Yii::app()->user, 'isAdmin') && Yii::app()->user->isAdmin()) $controller->layout = Yum::module()->adminLayout; return parent::beforeControllerAction($controller, $action); } } '', 'ldap_port' => '', 'ldap_basedn' => '', 'ldap_protocol' => '', 'ldap_autocreate' => '', 'ldap_tls' => '', 'ldap_transfer_attr' => '', 'ldap_transfer_pw' => ''); private $_urls=array( 'login'=>array('//user/user'), 'return'=>array('//user/user/index'), 'firstVisit'=>array('//user/privacy/update'), 'delete'=>array('//user/user/delete'), // Page to go after admin logs in 'returnAdmin'=>false, // Page to go to after logout 'returnLogout'=>array('//user/user/login')); private $_views = array( 'login' => '/user/login', 'menu' => '/user/menu', 'registration' => '/registration/registration', 'activate' => '/user/resend_activation', 'message' => '/user/message', 'passwordForm' => '/user/_activation_passwordform', 'messageCompose' =>'application.modules.message.views.message.compose'); // LoginType : // If you want to activate many types of login just sum up the values below and assign them to 'loginType' in // the user module configuration. const LOGIN_BY_USERNAME = 1; const LOGIN_BY_EMAIL = 2; const LOGIN_BY_OPENID = 4; const LOGIN_BY_FACEBOOK = 8; const LOGIN_BY_TWITTER = 16; const LOGIN_BY_LDAP = 32; // Allow login only by username by default. public $loginType = 1; /** * Defines all Controllers of the User Management Module and maps them to * shorter terms for using in the url * @var array */ public $controllerMap=array( 'default'=>array('class'=>'YumModule.controllers.YumDefaultController'), 'rest'=>array('class'=>'YumModule.controllers.YumRestController'), 'csv'=>array('class'=>'YumModule.controllers.YumCsvController'), 'auth'=>array('class'=>'YumModule.controllers.YumAuthController'), 'install'=>array('class'=>'YumModule.controllers.YumInstallController'), 'statistics'=>array('class'=>'YumModule.controllers.YumStatisticsController'), 'translation'=>array('class'=>'YumModule.controllers.YumTranslationController'), 'user'=>array('class'=>'YumModule.controllers.YumUserController'), // workaround to allow the url application/user/login: 'login'=>array('class'=>'YumModule.controllers.YumUserController') ); // Table names private $_tables = array( 'user' => 'user', 'privacySetting' => 'privacysetting', 'translation' => 'translation', 'message' => 'message', 'usergroup' => 'user_group', 'usergroupMessage' => 'user_group_message', 'profile' => 'profile', 'profileComment' => 'profile_comment', 'profileVisit' => 'profile_visit', 'profileField' => 'profile_field', 'role' => 'role', 'userRole' => 'user_role', 'membership' => 'membership', 'payment' => 'payment', 'friendship' => 'friendship', 'permission' => 'permission', 'action' => 'action', ); public $passwordRequirements = array( 'minLen' => 6, 'maxLen' => 128, 'minLowerCase' => 0, 'minUpperCase'=>0, 'minDigits' => 0, 'maxRepetition' => 3, ); public $usernameRequirements=array( 'minLen'=>3, 'maxLen'=>30, 'match' => '/^[A-Za-z0-9_]+$/u', 'dontMatchMessage' => 'Incorrect symbol\'s. (A-z0-9)', ); /** * Implements support for getting URLs, Tables and Views * @param string $name */ public function __get($name) { if(substr($name, -3) === 'Url') if(isset($this->_urls[substr($name, 0, -3)])) return $this->_urls[substr($name, 0, -3)]; if(substr($name, -4) === 'View') if(isset($this->_views[substr($name, 0, -4)])) return $this->_views[substr($name, 0, -4)]; if(substr($name, -5) === 'Table') if(isset($this->_tables[substr($name, 0, -5)])) return $this->_tables[substr($name, 0, -5)]; return parent::__get($name); } /** * Implements support for setting URLs and Views * @param string $name * @param mixed $value */ public function __set($name,$value) { if(substr($name,-3)==='Url') { if(isset($this->_urls[substr($name,0,-3)])) $this->_urls[substr($name,0,-3)]=$value; } if(substr($name,-4)==='View') { if(isset($this->_views[substr($name,0,-4)])) $this->_views[substr($name,0,-4)]=$value; } if(substr($name,-5)==='Table') { if(isset($this->_tables[substr($name,0,-5)])) $this->_tables[substr($name,0,-5)]=$value; } //parent::__set($name,$value); } public function init() { $this->setImport(array( 'YumModule.controllers.*', 'YumModule.models.*', 'YumModule.components.*', 'YumModule.core.*', )); } public function beforeControllerAction($controller, $action) { // Do not enable Debug mode when in Production Mode if(!defined('YII_DEBUG')) $this->debug = false; if(method_exists(Yii::app()->user, 'isAdmin') && Yii::app()->user->isAdmin()) $controller->layout = Yum::module()->adminLayout; return parent::beforeControllerAction($controller, $action); } }
[b]Fatal error: Class 'UserModule' not found in C:\xampp\htdocs\Yii\framework\YiiBase.php on line 208[/b]


I added the bold, can someone tell me what I missed?
0

#497 User is offline   VapidWorx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-November 12

Posted 01 December 2012 - 03:04 AM

I needed to turn short_open_tags on.

Some of the php files are only opened by <? not full <?php
0

#498 User is offline   thyseus 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 300
  • Joined: 18-April 09
  • Location:Leipzig, Germany

Posted 01 December 2012 - 01:57 PM

The git repository of yii-user-management uses short tags for development. I will replace all <? with <?php for backward compatibility in the next releases. Thank you for mentioning this.
0

#499 User is offline   VapidWorx 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 30-November 12

Posted 01 December 2012 - 02:59 PM

Also in /modules/message/models/YumMessage.php


	public function unread($id = false) 
	{
		if(!$id)
			$id = Yii::app()->user->getId();
						
		$this->getDbCriteria()->mergeWith(array(
					'condition' => "to_user_id = {id} and message_read = 0"
				));
		return $this;
	}


When this function runs it grabs username not id. And for the life of me I can't figure out where I should put setState code so it returns ID instead.
0

#500 User is offline   I-NOZex 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 17-November 12
  • Location:Portugal

Posted 02 December 2012 - 03:00 PM

hi, how i can get the NUMBER ID of active user?
i tried Yii::app()->user->getId() and Yii::app()->user->id but returns the user name :s
anyone can help? cumpz
B2R » Beat2Revolution v3.0b | Join and Share us
http://beat2revolution.net/

Posted Image
0

Share this topic:


  • (30 Pages)
  • +
  • « First
  • 23
  • 24
  • 25
  • 26
  • 27
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users