Logger::info(API_LOG_PREFIX . 'getting user {user}', ['module' => 'api', 'action' => 'get_user', 'user' => $user]);
if (!$user) {
- if (BaseApi::getCurrentUserID() === false) {
+ if (empty(BaseApi::getCurrentUserID())) {
BasicAuth::getCurrentUserID(true);
return false;
} else {
*/
function api_account_verify_credentials($type)
{
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
unset($_REQUEST["user_id"]);
{
$a = DI::app();
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
// convert $_POST array items to the form we use for web posts.
{
$a = DI::app();
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
if (empty($_FILES['media'])) {
$a = DI::app();
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
// params
*/
function api_statuses_destroy($type)
{
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
// params
*/
function api_favorites_create_destroy($type)
{
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
// for versioned api.
*/
function api_direct_messages_new($type)
{
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
*/
function api_direct_messages_destroy($type)
{
+ if (empty(BaseApi::getCurrentUserID())) {
+ throw new ForbiddenException();
+ }
+
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
// params
*/
function api_fr_photos_list($type)
{
- if (BaseApi::getCurrentUserID() === false) {
+ if (empty(BaseApi::getCurrentUserID())) {
throw new ForbiddenException();
}
$r = DBA::toArray(DBA::p(
*/
function api_fr_photo_create_update($type)
{
- if (BaseApi::getCurrentUserID() === false) {
+ if (empty(BaseApi::getCurrentUserID())) {
throw new ForbiddenException();
}
// input params
*/
function api_fr_photo_detail($type)
{
- if (BaseApi::getCurrentUserID() === false) {
+ if (empty(BaseApi::getCurrentUserID())) {
throw new ForbiddenException();
}
if (empty($_REQUEST['photo_id'])) {
*/
function api_account_update_profile_image($type)
{
- if (BaseApi::getCurrentUserID() === false) {
+ if (empty(BaseApi::getCurrentUserID())) {
throw new ForbiddenException();
}
// input params