Merge pull request #356 from owncloud/remove-old-method

Remove old methods
This commit is contained in:
VicDeo 2014-09-08 22:11:43 +03:00
commit 9848db84f5
3 changed files with 0 additions and 69 deletions

View File

@ -170,35 +170,4 @@ class SessionController extends Controller{
}
exit();
}
public static function info(){
self::preDispatch();
$items = @$_POST['items'];
$info = array();
if (is_array($items)){
$session = new Db\Session();
$info = $session->getInfoByFileId($items);
}
\OCP\JSON::success(array(
"info" => $info
));
}
public static function listAll(){
self::preDispatch();
$session = new Db\Session();
$sessions = $session->getCollection();
$preparedSessions = array_map(
function($x){
return ($x['es_id']);
}, $sessions
);
\OCP\JSON::success(array(
"session_list" => $preparedSessions
));
}
}

View File

@ -42,20 +42,6 @@ $this->create('documents_documents_list', 'ajax/documents/list')
/**
* Session routes
*/
$this->create('documents_session_list', 'ajax/session/list')
->get()
->action('\OCA\Documents\SessionController', 'listAll')
;
$this->create('documents_session_list', 'ajax/session/list')
->post()
->action('\OCA\Documents\SessionController', 'listAll')
;
$this->create('documents_session_info', 'ajax/session/info')
->post()
->action('\OCA\Documents\SessionController', 'info')
;
$this->create('documents_session_joinasuser', 'ajax/session/joinasuser/{file_id}')
->get()
->action('\OCA\Documents\SessionController', 'joinAsUser')

View File

@ -157,30 +157,6 @@ class Session extends \OCA\Documents\Db {
return $info;
}
public function getInfoByFileId($fileIds){
if (!is_array($fileIds)){
return array();
}
$stmt = $this->buildInQuery('file_id', $fileIds);
$result = $this->execute('
SELECT `s`.*, COUNT(`m`.`member_id`) AS `users`
FROM ' . $this->tableName . ' AS `s`
LEFT JOIN `*PREFIX*documents_member` AS `m` ON `s`.`es_id`=`m`.`es_id`
AND `m`.`status`=' . Db\Member::MEMBER_STATUS_ACTIVE . '
WHERE `s`.`file_id` ' . $stmt .'
GROUP BY `m`.`es_id`',
$fileIds
);
$info = $result->fetchAll();
if (!is_array($info)){
$info = array();
}
return $info;
}
protected function getUniqueSessionId(){
$testSession = new Session();
do{