Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions system/application/controllers/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ public function __construct(){
//Session login first
if ($this->data['native']===true || $this->data['native']==='true'){
$this->user = $this->api_users->do_session_login($this->data['book']->book_id);
if (!$this->user && $this->api_users->is_super()) $this->_output_error(StatusCodes::HTTP_UNAUTHORIZED, 'You do not have permission to modify this book');
if (!$this->user) $this->_output_error(StatusCodes::HTTP_UNAUTHORIZED, 'You are not logged in');
if (!$this->user && !$this->api_users->is_super()) $this->_output_error(StatusCodes::HTTP_UNAUTHORIZED, 'You are not logged in or do not have permission to modify this book');
// API key login
} else if (!$this->user = $this->api_users->do_login($this->data['email'], $this->data['api_key'], $this->data['host'], $this->data['book']->book_id)){
$this->_output_error(StatusCodes::HTTP_UNAUTHORIZED, 'Could not log in via API key');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function send_form($form, additional_values, success, redirect_url) {
}

var error = function(message) {
alert('Something went wrong while attempting to save: '+message);
alert('Something went wrong while attempting to save: '+message.responseJSON.error.message[0].value);
send_form_hide_loading();
}

Expand Down