HOR-4485
This commit is contained in:
18
config/oauthClients.php
Normal file
18
config/oauthClients.php
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'pm' => [
|
||||||
|
'clientId' => 'x-pm-local-client',
|
||||||
|
'clientSecret' => '179ad45c6ce2cb97cf1029e212046e81',
|
||||||
|
'clientName' => 'PM Web Designer',
|
||||||
|
'clientDescription' => 'ProcessMaker Web Designer App',
|
||||||
|
'clientWebsite' => 'www.processmaker.com',
|
||||||
|
],
|
||||||
|
'mobile' => [
|
||||||
|
'clientId' => 'x-pm-mobile-client',
|
||||||
|
'clientSecret' => '4426746995afa07e7485df1055471800',
|
||||||
|
'clientName' => 'PM Mobile App',
|
||||||
|
'clientDescription' => 'PM Mobile App for Android and iOS',
|
||||||
|
'clientWebsite' => 'www.processmaker.com',
|
||||||
|
],
|
||||||
|
];
|
||||||
@@ -2131,7 +2131,8 @@ class WorkspaceTools
|
|||||||
{
|
{
|
||||||
$this->initPropel(true);
|
$this->initPropel(true);
|
||||||
$pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client');
|
$pmRestClient = OauthClientsPeer::retrieveByPK('x-pm-local-client');
|
||||||
if (empty($pmRestClient)) {
|
$pmMobileRestClient = OauthClientsPeer::retrieveByPK(config('oauthClients.mobile.clientId'));
|
||||||
|
if (empty($pmRestClient) || empty($pmMobileRestClient)) {
|
||||||
if (!is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
|
if (!is_file(PATH_DATA . 'sites/' . $workspace . '/' . '.server_info')) {
|
||||||
$_CSERVER = $_SERVER;
|
$_CSERVER = $_SERVER;
|
||||||
unset($_CSERVER['REQUEST_TIME']);
|
unset($_CSERVER['REQUEST_TIME']);
|
||||||
@@ -2159,6 +2160,7 @@ class WorkspaceTools
|
|||||||
$skin
|
$skin
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (empty($pmRestClient)) {
|
||||||
$oauthClients = new OauthClients();
|
$oauthClients = new OauthClients();
|
||||||
$oauthClients->setClientId('x-pm-local-client');
|
$oauthClients->setClientId('x-pm-local-client');
|
||||||
$oauthClients->setClientSecret('179ad45c6ce2cb97cf1029e212046e81');
|
$oauthClients->setClientSecret('179ad45c6ce2cb97cf1029e212046e81');
|
||||||
@@ -2167,6 +2169,18 @@ class WorkspaceTools
|
|||||||
$oauthClients->setClientWebsite('www.processmaker.com');
|
$oauthClients->setClientWebsite('www.processmaker.com');
|
||||||
$oauthClients->setRedirectUri($endpoint);
|
$oauthClients->setRedirectUri($endpoint);
|
||||||
$oauthClients->save();
|
$oauthClients->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($pmMobileRestClient) && !empty(config('oauthClients.mobile.clientId'))) {
|
||||||
|
$oauthClients = new OauthClients();
|
||||||
|
$oauthClients->setClientId(config('oauthClients.mobile.clientId'));
|
||||||
|
$oauthClients->setClientSecret(config('oauthClients.mobile.clientSecret'));
|
||||||
|
$oauthClients->setClientName(config('oauthClients.mobile.clientName'));
|
||||||
|
$oauthClients->setClientDescription(config('oauthClients.mobile.clientDescription'));
|
||||||
|
$oauthClients->setClientWebsite(config('oauthClients.mobile.clientWebsite'));
|
||||||
|
$oauthClients->setRedirectUri($endpoint);
|
||||||
|
$oauthClients->save();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
eprintln("WARNING! No server info found!", 'red');
|
eprintln("WARNING! No server info found!", 'red');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1060,6 +1060,20 @@ class InstallerModule extends Controller
|
|||||||
'USR_UID' => '00000000000000000000000000000001'
|
'USR_UID' => '00000000000000000000000000000001'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (!empty(config('oauthClients.mobile.clientId'))) {
|
||||||
|
DB::connection(self::CONNECTION_INSTALL)
|
||||||
|
->table('OAUTH_CLIENTS')
|
||||||
|
->insert([
|
||||||
|
'CLIENT_ID' => config('oauthClients.mobile.clientId'),
|
||||||
|
'CLIENT_SECRET' => config('oauthClients.mobile.clientSecret'),
|
||||||
|
'CLIENT_NAME' => config('oauthClients.mobile.clientName'),
|
||||||
|
'CLIENT_DESCRIPTION' => config('oauthClients.mobile.clientDescription'),
|
||||||
|
'CLIENT_WEBSITE' => config('oauthClients.mobile.clientWebsite'),
|
||||||
|
'REDIRECT_URI' => $endpoint,
|
||||||
|
'USR_UID' => '00000000000000000000000000000001'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$indexFileUpdated = true;
|
$indexFileUpdated = true;
|
||||||
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
if (defined('PARTNER_FLAG') || isset($_REQUEST['PARTNER_FLAG'])) {
|
||||||
$this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], $langUri, $skinUri);
|
$this->buildParternExtras($adminUsername, $adminPassword, $_REQUEST['workspace'], $langUri, $skinUri);
|
||||||
|
|||||||
@@ -1397,6 +1397,17 @@ class adminProxy extends HttpProxyController
|
|||||||
$oauthClients->setRedirectUri($endpoint);
|
$oauthClients->setRedirectUri($endpoint);
|
||||||
$oauthClients->save();
|
$oauthClients->save();
|
||||||
|
|
||||||
|
if (!empty(config('oauthClients.mobile.clientId'))) {
|
||||||
|
$oauthClients = new OauthClients();
|
||||||
|
$oauthClients->setClientId(config('oauthClients.mobile.clientId'));
|
||||||
|
$oauthClients->setClientSecret(config('oauthClients.mobile.clientSecret'));
|
||||||
|
$oauthClients->setClientName(config('oauthClients.mobile.clientName'));
|
||||||
|
$oauthClients->setClientDescription(config('oauthClients.mobile.clientDescription'));
|
||||||
|
$oauthClients->setClientWebsite(config('oauthClients.mobile.clientWebsite'));
|
||||||
|
$oauthClients->setRedirectUri($endpoint);
|
||||||
|
$oauthClients->save();
|
||||||
|
}
|
||||||
|
|
||||||
$result['success'] = true;
|
$result['success'] = true;
|
||||||
$result['message'] = '';
|
$result['message'] = '';
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -220,6 +220,20 @@ class Installer
|
|||||||
'USR_UID' => '00000000000000000000000000000001'
|
'USR_UID' => '00000000000000000000000000000001'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if (!empty(config('oauthClients.mobile.clientId'))) {
|
||||||
|
DB::connection(self::CONNECTION_INSTALL)
|
||||||
|
->table('OAUTH_CLIENTS')
|
||||||
|
->insert([
|
||||||
|
'CLIENT_ID' => config('oauthClients.mobile.clientId'),
|
||||||
|
'CLIENT_SECRET' => config('oauthClients.mobile.clientSecret'),
|
||||||
|
'CLIENT_NAME' => config('oauthClients.mobile.clientName'),
|
||||||
|
'CLIENT_DESCRIPTION' => config('oauthClients.mobile.clientDescription'),
|
||||||
|
'CLIENT_WEBSITE' => config('oauthClients.mobile.clientWebsite'),
|
||||||
|
'REDIRECT_URI' => $endpoint,
|
||||||
|
'USR_UID' => '00000000000000000000000000000001'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
/* Dump schema rbac && data */
|
/* Dump schema rbac && data */
|
||||||
$pws = PATH_RBAC_MYSQL_DATA . $schema;
|
$pws = PATH_RBAC_MYSQL_DATA . $schema;
|
||||||
$qrs = $this->query_sql_file(PATH_RBAC_MYSQL_DATA . $schema);
|
$qrs = $this->query_sql_file(PATH_RBAC_MYSQL_DATA . $schema);
|
||||||
|
|||||||
Reference in New Issue
Block a user