35 $this->helper =
new APIHelper(
$class, $searchFilter, $outputFilter, $constraints);
40 return $this->helper->query();
46 return checkRole($this->roles);
51 return ($this->roles ==
"");
166 private static $endpoints =
null;
175 APIManager::$endpoints[$endpoint] =
$handler;
180 if (!APIManager::$endpoints)
182 APIManager::$endpoints = array();
186 return APIManager::$endpoints[$endpoint];
212 $t = checkIdentifier($_GET[
"token"]);
247 $password = $_REQUEST[
"password"];
256 return "ERROR|".LoginManager::$error;
265 return "ERROR|".LoginManager::$error;
278 $token->token = plainGUID();
280 $token->created_date = now();
281 $token->expiry_date =
null;
283 $token->last_access = now();
290 $expiryDate =
new DateTime();
291 $expiryDate->modify(
"+".$tokenLifetime);
292 $token->expiry_date = $expiryDate->format(
"Y-m-d H:i:s T");
296 Fakoli::JSONReturn(
$token,
true);
306 $t = checkIdentifier($_GET[
"token"]);
313 $expiryDate =
new DateTime();
314 $expiryDate->modify(
"+".$tokenLifetime);
315 $token->expiry_date = $expiryDate->format(
"Y-m-d H:i:s T");
328 Settings::setDefaultValue(
"api",
"token_lifetime",
"30 days",
"String",
"Specifies how long API authorization tokens stay valid. Leave blank to have tokens never expire");
339 $mgr->upgrade($version);
Provides a central management class for event handlers and common functionality for the api component...
getDefaultPage($section)
Returns the identifier for the default page in the section (i.e.
getAdminView($section)
Factory method to build the view class for displaying and manipulating section content for the specif...
getContent($section, $identifier)
Returns a SectionContent object for the specified section and identifier.
sendContent($section, $identifier)
Renders and sends the specified content for the given section.
static upgradeComponent($version)
static registerSectionContentManager()
static registerEndPoint($endpoint, $handler)
static getEndPoint($endpoint)
static registerAPIEndPoints()
static dispatch($endpoint)
static getUserToken($user_id)
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
FakoliException is the base exception class for all Fakoli errors.
static usingFeature()
Uses the specified framework feature(s).
static using()
Import the datamodels, views and manifest for the specified component(s).
static JSONreturn($object, $sendType=true, $wrap=true)
Return a DataItem to the client in JSON format.
static recordLoginAttempt($username, $mode, $token, $result)
Records a login attempt in the login audit trail.
static registerManager($type, $manager)
Registers a SectionContentManager for handling a specified section type.
static getValue($component, $name)
Retrieve the value of the specified Setting.
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
__construct($class, $roles="", $searchFilter=null, $outputFilter=null, $constraints="")
Provides the interface to the user model for the application.
$method
Pull out a simple reference to the request method.
Defines the interface required by a SectionContentManager.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content