forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchange_password.php
More file actions
23 lines (22 loc) · 923 Bytes
/
change_password.php
File metadata and controls
23 lines (22 loc) · 923 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
// Example usage
// change_password.php "admin_account admin_password mysql_password"
$_ENV["RAINLOOP_INCLUDE_AS_API"] = true;
include "/var/lib/rainloop/index.php";
$oConfig = \RainLoop\Api::Config();
// Change default login data / key
$oConfig->Set("security", "admin_login", $argv[1]);
$oConfig->Set("security", "admin_panel_key", $argv[1]);
$oConfig->SetPassword($argv[2]);
// Allow Contacts to be saved in database
$oConfig->Set("contacts", "enable", "On");
$oConfig->Set("contacts", "allow_sync", "On");
$oConfig->Set("contacts", "type", "mysql");
$oConfig->Set("contacts", "pdo_dsn", "mysql:host=127.0.0.1;port=3306;dbname=rainloop");
$oConfig->Set("contacts", "pdo_user", "rainloop");
$oConfig->Set("contacts", "pdo_password", $argv[3]);
// Plugins
$oConfig->Set("plugins", "enable", "On");
$oConfig->Set("plugins", "enabled_list", "add-x-originating-ip-header,hestia-change-password");
$oConfig->Save();
?>