BUG_14693 Some functionalities inside the BPMN designer are not working.

I move the Insert of the Oauth client id to the install class. This apply in the installation and in the creation of a new workspace.
This commit is contained in:
jennylee
2014-04-29 12:22:48 -04:00
parent ec643d4aac
commit 821ea63d02
2 changed files with 21 additions and 28 deletions

View File

@@ -147,7 +147,7 @@ class Installer
$this->run_query("GRANT ALL PRIVILEGES ON `$rb`.* TO $rb@'$host' IDENTIFIED BY '{$this->options['password']}' WITH GRANT OPTION", "Grant privileges for user $rb on database $rb");
$this->run_query("GRANT ALL PRIVILEGES ON `$rp`.* TO $rp@'$host' IDENTIFIED BY '{$this->options['password']}' WITH GRANT OPTION", "Grant privileges for user $rp on database $rp");
}
/* Dump schema workflow && data */
$this->log("Import database schema:\n");
@@ -164,7 +164,26 @@ class Installer
$this->log($qws, isset($qws['errors']));
$qwv = $this->query_sql_file(PATH_WORKFLOW_MYSQL_DATA . $values, $this->connection_database);
$this->log($qwv, isset($qwv['errors']));
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$workspace = $this->options['name'];
$endpoint = sprintf(
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
$workspace,
$lang,
SYS_SKIN
);
// inserting the outh_client
$query = ( "INSERT INTO OAUTH_CLIENTS (CLIENT_ID,CLIENT_SECRET,CLIENT_NAME,CLIENT_DESCRIPTION,CLIENT_WEBSITE,REDIRECT_URI,USR_UID ) VALUES
('x-pm-local-client','179ad45c6ce2cb97cf1029e212046e81','PM Web Designer','ProcessMaker Web Designer App','www.processmaker.com','" . $endpoint . "','00000000000000000000000000000001' )");
$this->run_query( $query );
/* Dump schema rbac && data */
$pws = PATH_RBAC_MYSQL_DATA . $schema;
mysql_select_db($rb, $this->connection_database);

View File

@@ -168,32 +168,6 @@ try {
$oServerConf =& serverConf::getSingleton();
$oServerConf->sucessfulLogin();
//
if (!(OauthClients::exists('x-pm-local-client'))) {
$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$endpoint = sprintf(
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
SYS_SYS,
$lang,
SYS_SKIN
);
$oauthClients = new OauthClients();
$oauthClients->setClientId('x-pm-local-client');
$oauthClients->setClientSecret('179ad45c6ce2cb97cf1029e212046e81');
$oauthClients->setClientName('PM Web Designer');
$oauthClients->setClientDescription('ProcessMaker Web Designer App');
$oauthClients->setClientWebsite('www.processmaker.com');
$oauthClients->setRedirectUri($endpoint);
$oauthClients->setUsrUid("00000000000000000000000000000001");
$oauthClients->save();
}
// Assign the uid of user to userloggedobj
$RBAC->loadUserRolePermission($RBAC->sSystem, $uid);
$res = $RBAC->userCanAccess('PM_LOGIN');