moving business model sources

This commit is contained in:
Erik Amaru Ortiz
2013-11-04 13:11:58 -04:00
parent 9991a261bc
commit 8ce4be68e4
7 changed files with 42 additions and 9 deletions

View File

@@ -4,7 +4,6 @@ switch ($_SERVER['REQUEST_METHOD']) {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'oauth2/authorize' );
$erik = 'neyek';
G::RenderPage('publish', 'minimal');
break;
@@ -19,6 +18,7 @@ switch ($_SERVER['REQUEST_METHOD']) {
\Api\OAuth2\Server::setPmClientId('x-pm-local-client');
$oauthServer = new \Api\OAuth2\Server();
$userid = $_SESSION['USER_LOGGED'];
$authorize = isset($_POST['authorize']) ? (bool) $_POST['authorize'] : false;

View File

@@ -46,6 +46,8 @@ class Server implements iAuthenticate
// Pass a storage object or array of storage objects to the OAuth2 server class
$this->server = new \OAuth2\Server($this->storage);
$this->server->setConfig('enforce_state', false);
// Add the "Authorization Code" grant type (this is where the oauth magic happens)
$this->server->addGrantType(new \OAuth2\GrantType\AuthorizationCode($this->storage));

View File

@@ -1,9 +1,13 @@
<?php
require_once PATH_CORE . 'services/oauth2/PmPdo.php';
$dsn = 'mysql:dbname=wf_workflow;host=localhost';
$username = 'root';
$password = 'sample';
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port";
$dsn = DB_ADAPTER.':host='.$host.';dbname='.DB_NAME.$port;
$username = DB_USER;
$password = DB_PASS;
$this->scope = array(
'view_processes' => 'View Processes',

View File

@@ -510,6 +510,8 @@ try {
Bootstrap::registerSystemClasses();
Bootstrap::registerDir('BusinessModel', PATH_HOME . 'engine/BusinessModel/');
require_once PATH_THIRDPARTY . '/pear/PEAR.php';
//Bootstrap::LoadSystem( 'pmException' );