Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 3bbc0b6

Browse files
author
Charles Marion
committed
ENH: Added web api module
migrated rest method: midas.info midas.login midas.upload.generatetoken midas.upload.getoffset
1 parent 22bc0ce commit 3bbc0b6

File tree

191 files changed

+14486
-1284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+14486
-1284
lines changed

core/AppController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ public function preDispatch()
3636
$this->view->version=Zend_Registry::get('configDatabase')->version;
3737
}
3838

39+
require_once BASE_PATH . '/core/models/dao/UserDao.php';
40+
require_once BASE_PATH . '/core/models/dao/ItemDao.php';
3941
//Init Session
4042
if($fc->getRequest()->getActionName()!='login'||$fc->getRequest()->getControllerName()!='user')
4143
{
42-
require_once BASE_PATH . '/core/models/dao/UserDao.php';
43-
require_once BASE_PATH . '/core/models/dao/ItemDao.php';
44+
4445

4546
if (isset($_POST['sid']))
4647
{

core/Bootstrap.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ protected function _initRouter()
173173
$route1 = new Zend_Controller_Router_Route(
174174
Zend_Registry::get('configGlobal')->webdav->path.'/:action/*',
175175
array(
176-
'controller' => 'webdav',
176+
'module' => 'webdav',
177+
'controller' => ':action',
177178
'action' => ':action'
178179
)
179180
);

core/controllers/AdminController.php

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,26 @@ function indexAction()
7979
switch (Zend_Registry::get('configDatabase')->database->adapter)
8080
{
8181
case 'PDO_MYSQL':
82-
$this->Component->Utility->run_mysql_from_file(BASE_PATH.'/modules/'.$moduleName.'/database/mysql/'.$allModules[$moduleName]->version.'.sql',
83-
Zend_Registry::get('configDatabase')->database->params->host,
84-
Zend_Registry::get('configDatabase')->database->params->username,
85-
Zend_Registry::get('configDatabase')->database->params->password,
86-
Zend_Registry::get('configDatabase')->database->params->dbname,
87-
Zend_Registry::get('configDatabase')->database->params->port);
82+
if(file_exists(BASE_PATH.'/modules/'.$moduleName.'/database/mysql/'.$allModules[$moduleName]->version.'.sql'))
83+
{
84+
$this->Component->Utility->run_mysql_from_file(BASE_PATH.'/modules/'.$moduleName.'/database/mysql/'.$allModules[$moduleName]->version.'.sql',
85+
Zend_Registry::get('configDatabase')->database->params->host,
86+
Zend_Registry::get('configDatabase')->database->params->username,
87+
Zend_Registry::get('configDatabase')->database->params->password,
88+
Zend_Registry::get('configDatabase')->database->params->dbname,
89+
Zend_Registry::get('configDatabase')->database->params->port);
90+
}
8891
break;
8992
case 'PDO_PGSQL':
90-
$this->Component->Utility->run_pgsql_from_file(BASE_PATH.'/modules/'.$key.'/database/pgsql/'.$allModules[$moduleName]->version.'.sql',
91-
Zend_Registry::get('configDatabase')->database->params->host,
92-
Zend_Registry::get('configDatabase')->database->params->username,
93-
Zend_Registry::get('configDatabase')->database->params->password,
94-
Zend_Registry::get('configDatabase')->database->params->dbname,
95-
Zend_Registry::get('configDatabase')->database->params->port);
93+
if(file_exists(BASE_PATH.'/modules/'.$key.'/database/pgsql/'.$allModules[$moduleName]->version.'.sql'))
94+
{
95+
$this->Component->Utility->run_pgsql_from_file(BASE_PATH.'/modules/'.$key.'/database/pgsql/'.$allModules[$moduleName]->version.'.sql',
96+
Zend_Registry::get('configDatabase')->database->params->host,
97+
Zend_Registry::get('configDatabase')->database->params->username,
98+
Zend_Registry::get('configDatabase')->database->params->password,
99+
Zend_Registry::get('configDatabase')->database->params->dbname,
100+
Zend_Registry::get('configDatabase')->database->params->port);
101+
}
96102
break;
97103
}
98104
}

core/layouts/layout.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
<ul>
6868
<li class="first">
6969
<?php
70-
if($this->logged)
70+
if($this->logged&&isset($this->userDao))
7171
{
7272
echo '
7373
<b><a id="topUserName" href="'.$this->webroot.'/user/'.$this->userDao->getUserId().'" >'.$this->userDao->getFullName().' <img class="arrowUser" src="'.$this->coreWebroot.'/public/images/icons/arrow-user.gif" alt ="" /> </a> </b>

library/MIDAS/models/MIDASDatabasePdo.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,12 @@ public function getValue($var, $key, $dao)
7474
{
7575
require_once BASE_PATH.'/library/MIDAS/models/ModelLoader.php';
7676
$this->ModelLoader = new MIDAS_ModelLoader();
77-
$model = $this->ModelLoader->loadModel($this->_mainData[$var]['model']);
77+
$module='';
78+
if(isset($this->_mainData[$var]['module'])&&$this->_mainData[$var]['module']=='core')
79+
{
80+
$module=$this->_mainData[$var]['module'];
81+
}
82+
$model = $this->ModelLoader->loadModel($this->_mainData[$var]['model'],$module);
7883
if(!$dao->get($this->_mainData[$var]['parent_column']))
7984
{
8085
throw new Zend_Exception($this->_mainData[$var]['parent_column']. " is not defined in the dao: ".get_class($dao));
@@ -85,7 +90,12 @@ public function getValue($var, $key, $dao)
8590
{
8691
require_once BASE_PATH.'/library/MIDAS/models/ModelLoader.php';
8792
$this->ModelLoader = new MIDAS_ModelLoader();
88-
$model = $this->ModelLoader->loadModel($this->_mainData[$var]['model']);
93+
$module='';
94+
if(isset($this->_mainData[$var]['module'])&&$this->_mainData[$var]['module']=='core')
95+
{
96+
$module=$this->_mainData[$var]['module'];
97+
}
98+
$model = $this->ModelLoader->loadModel($this->_mainData[$var]['model'],$module);
8999
$key = $model->getKey();
90100
if($this->_mainData[$var]['child_column']==$key)
91101
{

library/MIDAS/models/MIDASModel.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,25 @@ public function findBy($var, $value)
258258

259259

260260
/** load Dao class*/
261-
public function loadDaoClass($name)
261+
public function loadDaoClass($name,$module='core')
262262
{
263-
Zend_Loader::loadClass($name, BASE_PATH . '/core/models/dao');
264-
if (!class_exists($name))
263+
if($module=='core')
265264
{
266-
throw new Zend_Exception('Unable to load dao class ' . $name);
265+
Zend_Loader::loadClass($name, BASE_PATH . '/core/models/dao');
266+
if (!class_exists($name))
267+
{
268+
throw new Zend_Exception('Unable to load dao class ' . $name);
269+
}
267270
}
271+
else
272+
{
273+
require_once BASE_PATH . "/modules/$module/models/dao/$name.php";
274+
if (!class_exists(ucfirst($module).'_'.$name))
275+
{
276+
throw new Zend_Exception('Unable to load dao class ' . ucfirst($module).'_'.$name);
277+
}
278+
}
279+
268280
}
269281

270282

library/SabreDAV/lib/Sabre/CalDAV/CalendarRootNode.php

Lines changed: 0 additions & 74 deletions
This file was deleted.

library/SabreDAV/lib/Sabre/DAV/Auth/Backend/PDO.php

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)