Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Working with users/Creating Users external

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-27-2015, 01:26 PM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Working with users/Creating Users external

If you can create a user with the following:

$profile->setLogin('bit-bucket@x-cart.com');
$profile->setPassword(\XLite\Core\Auth::encryptPassword('te ster'));

Is there a way to set the user access level to Admin instead of Customer?

Any help is appreciated.

Thanx
__________________
V5.2.13
Reply With Quote
  #2  
Old 03-02-2015, 09:59 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Working with users/Creating Users external

Maybe try
Code:
$profile->setAccessLevel(100);
Just guessing. Curious if it works!
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 03-02-2015, 11:44 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Working with users/Creating Users external

totaltec.. I tried that and it does set them as administrator but the Administrator role still has be be added to "roles".

In other words.. It sets the "Access Level" to administrator under the user tab but it will not add the Administrator the "Roles".
__________________
V5.2.13
Reply With Quote
  #4  
Old 03-03-2015, 07:15 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Working with users/Creating Users external

totaltec, Thanks for the advice.

I tried that and it does set the Access level to Administrator but to full work it also needs to set the "Roles" as Administrator. Or, add the Administrator to the Roles.
__________________
V5.2.13
Reply With Quote
  #5  
Old 03-03-2015, 04:30 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Working with users/Creating Users external

Quote:
Originally Posted by skit
totaltec, Thanks for the advice.

I tried that and it does set the Access level to Administrator but to full work it also needs to set the "Roles" as Administrator. Or, add the Administrator to the Roles.

Looks a little tougher to figure this part out. Something like $profile->addPermissions($permissions), but I am not sure what the value of $permissions should be! Or if that method is even accessible to that object.

I'm shooting in the dark here, glad the first bit worked. Perhaps Tony or someone else with knowledge can shed some light. I could certainly work this out for you, but I can't do it off the top of my head without research.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #6  
Old 03-04-2015, 05:49 AM
 
skit skit is offline
 

Advanced Member
  
Join Date: Feb 2015
Posts: 40
 

Default Re: Working with users/Creating Users external

I think I got it. You have to add the role after the user is created.

$profile->addRoles($role);
$profile->create();
$role->addProfiles($profile);
__________________
V5.2.13
Reply With Quote

The following user thanks skit for this useful post:
totaltec (03-04-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:45 PM.

   

 
X-Cart forums © 2001-2020