mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 13:56:01 +01:00
configure phpmyadmin config.inc for auto login
This commit is contained in:
@@ -591,7 +591,7 @@ app.controller('phpMyAdmin', function ($scope, $http, $window) {
|
||||
function ListInitialDatas(response) {
|
||||
$scope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
var rUrl = '/phpmyadmin/signin.php?username=' + response.data.username + '&token=' + response.data.token;
|
||||
var rUrl = '/phpmyadmin/phpmyadminsignin.php?username=' + response.data.username + '&token=' + response.data.token;
|
||||
$window.location.href = rUrl;
|
||||
}
|
||||
else {}
|
||||
|
||||
@@ -166,7 +166,6 @@ def generateAccess(request):
|
||||
token = randomPassword.generate_pass()
|
||||
gdb.token = token
|
||||
gdb.save()
|
||||
|
||||
except:
|
||||
## Key generation
|
||||
|
||||
@@ -242,7 +241,7 @@ def fetchDetailsPHPMYAdmin(request):
|
||||
mysqlUtilities.addUserToDB(db.dbName, admin.userName, password.decode(), createUser)
|
||||
createUser = 0
|
||||
|
||||
returnURL = '/phpmyadmin/signin.php?username=%s&password=%s' % (admin.userName, password.decode())
|
||||
returnURL = '/phpmyadmin/phpmyadminsignin.php?username=%s&password=%s' % (admin.userName, password.decode())
|
||||
return redirect(returnURL)
|
||||
else:
|
||||
return redirect(loadLoginPage)
|
||||
@@ -251,4 +250,4 @@ def fetchDetailsPHPMYAdmin(request):
|
||||
except BaseException as msg:
|
||||
data_ret = {'status': 0, 'createDBStatus': 0, 'error_message': str(msg)}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
return HttpResponse(json_data)
|
||||
@@ -681,12 +681,28 @@ class preFlightsChecks:
|
||||
|
||||
writeToFile = open('/usr/local/CyberCP/public/phpmyadmin/config.inc.php', 'w')
|
||||
|
||||
writeE = 1
|
||||
|
||||
phpMyAdminContent = """
|
||||
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||
$cfg['Servers'][$i]['auth_type'] = 'signon';
|
||||
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
|
||||
$cfg['Servers'][$i]['SignonURL'] = 'phpmyadminsignin.php';
|
||||
"""
|
||||
|
||||
for items in data:
|
||||
if items.find('blowfish_secret') > -1:
|
||||
writeToFile.writelines(
|
||||
"$cfg['blowfish_secret'] = '" + rString + "'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */\n")
|
||||
else:
|
||||
if items.find('/* Authentication type */') > -1:
|
||||
writeToFile.writelines(items)
|
||||
writeToFile.write(phpMyAdminContent)
|
||||
writeE = 0
|
||||
if items.find("$cfg['Servers'][$i]['AllowNoPassword']") > -1:
|
||||
writeE = 1
|
||||
else:
|
||||
if writeE:
|
||||
writeToFile.writelines(items)
|
||||
|
||||
writeToFile.writelines("$cfg['TempDir'] = '/usr/local/CyberCP/public/phpmyadmin/tmp';\n")
|
||||
|
||||
|
||||
@@ -228,12 +228,28 @@ class Upgrade:
|
||||
|
||||
writeToFile = open('/usr/local/CyberCP/public/phpmyadmin/config.inc.php', 'w')
|
||||
|
||||
writeE = 1
|
||||
|
||||
phpMyAdminContent = """
|
||||
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||
$cfg['Servers'][$i]['auth_type'] = 'signon';
|
||||
$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
|
||||
$cfg['Servers'][$i]['SignonURL'] = 'phpmyadminsignin.php';
|
||||
"""
|
||||
|
||||
for items in data:
|
||||
if items.find('blowfish_secret') > -1:
|
||||
writeToFile.writelines(
|
||||
"$cfg['blowfish_secret'] = '" + rString + "'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */\n")
|
||||
else:
|
||||
if items.find('/* Authentication type */') > -1:
|
||||
writeToFile.writelines(items)
|
||||
writeToFile.write(phpMyAdminContent)
|
||||
writeE = 0
|
||||
if items.find("$cfg['Servers'][$i]['AllowNoPassword']") > -1:
|
||||
writeE = 1
|
||||
else:
|
||||
if writeE:
|
||||
writeToFile.writelines(items)
|
||||
|
||||
writeToFile.writelines("$cfg['TempDir'] = '/usr/local/CyberCP/public/phpmyadmin/tmp';\n")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user