From be963e197735c257088d07d64e8342c27a5d6964 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sun, 4 Oct 2020 13:08:02 +0500 Subject: [PATCH] rainloop admin password --- install/install.py | 25 +++++++++++++++++++++++++ plogical/upgrade.py | 22 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/install/install.py b/install/install.py index 33d10de3d..47cd92a0a 100755 --- a/install/install.py +++ b/install/install.py @@ -483,6 +483,26 @@ class preFlightsChecks: def fixCyberPanelPermissions(self): + try: + import randomPassword + + content = """SetPassword('%s'); +echo $oConfig->Save() ? 'Done' : 'Error'; + +?>""" % (randomPassword.generate_pass()) + + writeToFile = open('/usr/local/CyberCP/public/rainloop.php', 'w') + writeToFile.write(content) + writeToFile.close() + except: + pass + ###### fix Core CyberPanel permissions command = "usermod -G lscpd,lsadm,nobody lscpd" @@ -629,6 +649,11 @@ class preFlightsChecks: command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + ### + + command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php' + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + def install_unzip(self): self.stdOut("Install unzip") try: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 5bea017d4..13293ebe6 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1651,6 +1651,25 @@ imap_folder_list_limit = 0 def fixPermissions(): try: + try: + import randomPassword + + content = """SetPassword('%s'); +echo $oConfig->Save() ? 'Done' : 'Error'; + +?>""" % (randomPassword.generate_pass()) + + writeToFile = open('/usr/local/CyberCP/public/rainloop.php', 'w') + writeToFile.write(content) + writeToFile.close() + except: + pass + Upgrade.stdOut("Fixing permissions..") command = "usermod -G lscpd,lsadm,nobody lscpd" @@ -1802,6 +1821,9 @@ imap_folder_list_limit = 0 command = 'chmod 640 /usr/local/lscp/cyberpanel/logs/access.log' Upgrade.executioner(command, 0) + command = '/usr/local/lsws/lsphp72/bin/php /usr/local/CyberCP/public/rainloop.php' + Upgrade.executioner(command, 0) + Upgrade.stdOut("Permissions updated.")