Skip to content

Commit

Permalink
bug fix: wp auto login
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jul 15, 2023
1 parent d32d25f commit 63cd467
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,10 @@ def AutoLogin(self, request=None, userID=None):
else:
return ACLManager.loadError()

# php = VirtualHost.getPHPString(self.data['PHPVersion'])
# FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
from managePHP.phpManager import PHPManager

php = PHPManager.getPHPString(WPobj.owner.phpSelection)
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)

url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
Expand All @@ -465,11 +467,11 @@ def AutoLogin(self, request=None, userID=None):

password = randomPassword.generate_pass(10)

command = 'sudo -u %s wp user create autologin %s --role=administrator --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
command = f'sudo -u %s {FinalPHPPath} /usr/bin/wp user create autologin %s --role=administrator --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
WPobj.owner.externalApp, '[email protected]', password, WPobj.path)
ProcessUtilities.executioner(command)

command = 'sudo -u %s wp user update autologin --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
command = f'sudo -u %s {FinalPHPPath} /usr/bin/wp user update autologin --user_pass="%s" --path=%s --skip-plugins --skip-themes' % (
WPobj.owner.externalApp, password, WPobj.path)
ProcessUtilities.executioner(command)

Expand Down

0 comments on commit 63cd467

Please sign in to comment.