2017-04-30 17:38:07 +02:00
|
|
|
<?php
|
|
|
|
|
2017-05-01 22:05:03 +02:00
|
|
|
class RestQueryGetBlogs extends RestQuery
|
2017-04-30 17:38:07 +02:00
|
|
|
{
|
2017-05-05 21:46:14 +02:00
|
|
|
public function __construct(){
|
|
|
|
|
|
|
|
global $core;
|
2017-05-11 23:10:01 +02:00
|
|
|
$this->blog_id = false; //this method doesn't depend on a blog_id
|
2017-05-05 21:46:14 +02:00
|
|
|
$this->required_perms = 'none'; //I want user have an account
|
|
|
|
|
|
|
|
if($this->is_allowed() === false){
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
//list the blogs the user can access
|
|
|
|
$blgs = $core->auth->getAllPermissions();
|
|
|
|
$ret = array();
|
|
|
|
foreach($blgs as $key=>$value){
|
|
|
|
$ret[] = $key;
|
|
|
|
}
|
|
|
|
$this->response_code = 200;
|
|
|
|
$this->response_message = $ret;
|
|
|
|
}
|
2017-04-30 17:38:07 +02:00
|
|
|
}
|