BUG_14693 Some functionalities inside the BPMN designer are not working if using a a new workspace.

An automatic registration was added when the user login for the first time into a new workspace.
This commit is contained in:
jennylee
2014-04-28 15:50:53 -04:00
parent 11f872e536
commit b3a1cc3532
2 changed files with 33 additions and 0 deletions

View File

@@ -206,6 +206,13 @@ class OauthClients extends BaseOauthClients
return array("numRecTotal" => $numRecTotal, "data" => $arrayData);
}
public function exists ($OclUid)
{
$oOcl = OauthClientsPeer::retrieveByPk( $OclUid );
return (is_object( $oOcl ) && get_class( $oOcl ) == 'OauthClients');
}
}
// OauthClients

View File

@@ -167,7 +167,33 @@ try {
G::LoadClass('serverConfiguration');
$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('179ad45c6ce2cb97cf1029e212046e82');
$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');