mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-02 10:20:46 +01:00
rainloop admin password
This commit is contained in:
@@ -483,6 +483,26 @@ class preFlightsChecks:
|
||||
|
||||
def fixCyberPanelPermissions(self):
|
||||
|
||||
try:
|
||||
import randomPassword
|
||||
|
||||
content = """<?php
|
||||
|
||||
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
|
||||
include '/usr/local/CyberCP/public/rainloop/index.php';
|
||||
|
||||
$oConfig = \RainLoop\Api::Config();
|
||||
$oConfig->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:
|
||||
|
||||
@@ -1651,6 +1651,25 @@ imap_folder_list_limit = 0
|
||||
def fixPermissions():
|
||||
try:
|
||||
|
||||
try:
|
||||
import randomPassword
|
||||
|
||||
content = """<?php
|
||||
$_ENV['RAINLOOP_INCLUDE_AS_API'] = true;
|
||||
include '/usr/local/CyberCP/public/rainloop/index.php';
|
||||
|
||||
$oConfig = \RainLoop\Api::Config();
|
||||
$oConfig->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.")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user