seek_quarry
[ class tree: seek_quarry ] [ index: seek_quarry ] [ all elements ]

Class: AdminController

Source Location: /controllers/admin_controller.php

Class Overview

Controller
   |
   --AdminController

Controller used to handle admin functionalities such as modify login and password, CREATE, UPDATE,DELETE operations for users, roles, locale, and crawls


Author(s):

  • Chris Pollett

Implements interfaces:

Variables

Methods


Inherited Variables

Inherited Methods

Class: Controller

Controller::__construct()
Controller::checkCSRFToken()
Checks if the form CSRF (cross-site request forgery preventing) token matches the given user and has not expired (1 hour till expires)
Controller::checkRequest()
Checks the request if a request is for a valid activity and if it uses the correct authorization key
Controller::clean()
Used to clean strings that might be tainted as originate from the user
Controller::displayView()
Send the provided view to output, drawing it with the given data variable, using the current locale for translation, and writing mode
Controller::generateCSRFToken()
Generates a cross site request forgery preventing token based on the provided user name, the current time and the hidden AUTH_KEY
Controller::processRequest()
This function should be overriden to web handle requests

Class Details

[line 60]
Controller used to handle admin functionalities such as modify login and password, CREATE, UPDATE,DELETE operations for users, roles, locale, and crawls



Tags:

author:  Chris Pollett


[ Top ]


Class Variables

$activities = array("signin", "manageAccount", "manageUsers",
        "manageRoles", "manageCrawls", "pageOptions", "resultsEditor",
        "manageMachines", "manageLocales", "crawlStatus", "mixCrawls",
        "machineStatus", "searchSources", "configure")

[line 81]

Says which activities (roughly methods invoke from the web) this

controller will respond to



Type:   array


[ Top ]

$models = array(
        "signin", "user", "activity", "crawl", "role", "locale", "profile",
        "searchfilters", "source", "machine", "cron")

[line 73]

Says which models to load for this controller.


Type:   array
Overrides:   Array


[ Top ]

$status_activities = array("crawlStatus", "machineStatus")

[line 91]

An array of activities which are periodically updated within other activities that they live. For example, within manage crawl, the current crawl status is updated every 20 or so seconds.


Type:   array


[ Top ]

$views = array("admin", "signin", "crawlstatus", "machinestatus")

[line 68]

Says which views to load for this controller

admin is the main one, signin has the login screen crawlstatus is used to see how many pages crawled by the current crawl



Type:   array
Overrides:   Array


[ Top ]



Class Methods


method checkSignin [line 188]

bool checkSignin( )

Checks whether the user name and password sent presumably by the signin form match a user in the database



Tags:

return:  whether they do or not


[ Top ]

method configure [line 2563]

array configure( )

Responsible for handling admin request related to the configure activity

The configure activity allows a user to set the work directory for storing data local to this SeekQuarry/Yioop instance. It also allows one to set the default language of the installation, dbms info, robot info, test info, as well as which machine acts as the queue server.




Tags:

return:  fields for available language, dbms, etc as well as results of processing sub activity if any


[ Top ]

method configureRequest [line 175]

void configureRequest( )

If there is no profile/work directory set up then this method get called to by pass any login and go to the configure screen.

The configure screen is only displayed if the user is connected from localhost in this case




[ Top ]

method convertArrayLines [line 1164]

string convertArrayLines( array $arr, [string $endline_string = "\n"], [bool $clean = false])

Converts an array of lines of strings into a single string with proper newlines, each line having been trimmed and potentially cleaned



Tags:

return:  a concatenated string of cleaned lines


Parameters:

array   $arr   the array of lines to be process
string   $endline_string   what string should be used to indicate the end of a line
bool   $clean   whether to clean each line

[ Top ]

method convertStringCleanArray [line 1190]

$lines convertStringCleanArray( string $str, [string $line_type = "url"])

Cleans a string consisting of lines, typically of urls into an array of clean lines. This is used in handling data from the crawl options text areas.



Tags:

return:  an array of clean lines


Parameters:

string   $str   contains the url data
string   $line_type   does additional cleaning depending on the type of the lines. For instance, if is "url" then a line not beginning with a url scheme will have http:// prepended.

[ Top ]

method crawlStatus [line 274]

array crawlStatus( )

Used to handle crawlStatus REST activities requesting the status of the current web crawl



Tags:

return:  contains crawl status of current crawl as well as info about prior crawls and which crawl is being used for default search results


[ Top ]

method editCrawlOption [line 954]

void editCrawlOption( array &$data, array $machine_urls)

Called from @see manageCrawls to edit the parameters for the next crawl (or current crawl) to be carried out by the machines $machine_urls. Updates $data array to be supplied to AdminView



Parameters:

array   &$data   an array of info to supply to AdminView
array   $machine_urls   string urls of machines managed by this Yioop name server on which to perform the crawl

[ Top ]

method editMix [line 1324]

array editMix( &$data, &$mix_ids, $mix)

Handles admin request related to the editing a crawl mix activity



Tags:

return:  info about the groups and their contents for a particular crawl mix


Parameters:

   &$data  
   &$mix_ids  
   $mix  

[ Top ]

method getCrawlParametersFromSeedInfo [line 898]

void getCrawlParametersFromSeedInfo( array &$crawl_params, array $seed_info)

Reads the parameters for a crawl from an array gotten from a crawl.ini file



Parameters:

array   &$crawl_params   parameters to write to queue_server
array   $seed_info   data from crawl.ini file

[ Top ]

method machineStatus [line 328]

array machineStatus( )

Gets data from the machineModel concerning the on/off states of the machines managed by this Yioop instance and then passes this data the the machinestatus view.



Tags:

return:  MACHINES field has information about each machine managed by this Yioop instance as well the on off status of its queue_servers and fetchers. The REFRESH field is used to tell the controller that the view shouldn't have its own sidemenu.


[ Top ]

method manageAccount [line 349]

array manageAccount( )

Used to handle the change current user password admin activity



Tags:

return:  SCRIPT field contains success or failure message


[ Top ]

method manageCrawls [line 748]

array manageCrawls( )

Used to handle the manage crawl activity.

This activity allows new crawls to be started, statistics about old crawls to be seen. It allows a user to stop the current crawl or restart an old crawl. It also allows a user to configure the options by which a crawl is conducted




Tags:

return:  information and statistics about crawls in the system as well as status messages on performing a given sub activity


[ Top ]

method manageLocales [line 2168]

array manageLocales( )

Handles admin request related to the manage locale activity

The manage locale activity allows a user to add/delete locales, view statistics about a locale as well as edit the string for that locale




Tags:

return:  info about current locales, statistics for each locale as well as potentially the currently set string of a locale and any messages about the success or failure of a sub activity.


[ Top ]

method manageMachines [line 1870]

array manageMachines( )

Handles admin request related to the managing the machines which perform crawls

With this activity an admin can add/delete machines to manage. For each managed machine, the admin can stop and start fetchers/queue_servers as well as look at their log files




Tags:

return:  MACHINES, their MACHINE_NAMES, data for FETCHER_NUMBERS drop-down


[ Top ]

method manageRoles [line 572]

array manageRoles( )

Used to handle the manage role activity.

This activity allows new roles to be added, old roles to be deleted and allows activities to be added to/deleted from a role




Tags:

return:  infomation about roles in the system, activities,etc. as well as status messages on performing a given sub activity


[ Top ]

method manageUsers [line 401]

array manageUsers( )

Used to handle the manage user activity.

This activity allows new users to be added, old users to be deleted and allows roles to be added to/deleted from a user




Tags:

return:  infomation about users of the system, roles, etc. as well as status messages on performing a given sub activity


[ Top ]

method mixCrawls [line 1224]

array mixCrawls( )

Handles admin request related to the crawl mix activity

The crawl mix activity allows a user to create/edit crawl mixes: weighted combinations of search indexes




Tags:

return:  info about available crawl mixes and changes to them as well as any messages about the success or failure of a sub activity.


[ Top ]

method pageOptions [line 1442]

array pageOptions( )

Handles admin request related to controlling file options to be used in a crawl

This activity allows a user to specify the page range size to be be used during a crawl as well as which file types can be downloaded




Tags:

return:  info about the groups and their contents for a particular crawl mix


[ Top ]

method processRequest [line 103]

void processRequest( )

This is the main entry point for handling requests to administer the Yioop/SeekQuarry site

ProcessRequest determines the type of request (signin , manageAccount, etc) is being made. It then calls the appropriate method to handle the given activity. Finally, it draws the relevant admin screen




Overrides Controller::processRequest() (This function should be overriden to web handle requests)

[ Top ]

method processSession [line 205]

array processSession( )

Determines the user's current allowed activities and current activity, then calls the method for the latter.

This is called from processRequest() once a user is logged in.




Tags:

return:  the results of doing the activity for display in the view


[ Top ]

method resultsEditor [line 1784]

array resultsEditor( )

Handles admin request related to the search filter activity

This activity allows a user to specify hosts whose web pages are to be filtered out the search results




Tags:

return:  info about the groups and their contents for a particular crawl mix


[ Top ]

method searchSources [line 2422]

array searchSources( )

Handles admin request related to the search sources activity

The search sources activity allows a user to add/delete search sources for video and news, it also allows a user to control which subsearches appear on the SearchView page




Tags:

return:  info about current search sources, and current sub-searches


[ Top ]

method signin [line 258]

array signin( )

This method is data to signin a user and initialize the data to be display in a view



Tags:

return:  empty array of data to show so far in view


[ Top ]

method startCrawl [line 852]

void startCrawl( array &$data, array $machine_urls, [ $seed_info = NULL])

Called from @see manageCrawls to start a new crawl on the machines $machine_urls. Updates $data array with crawl start message



Parameters:

array   &$data   an array of info to supply to AdminView
array   $machine_urls   string urls of machines managed by this Yioop name server on which to perform the crawl
   $seed_info  

[ Top ]

method systemCheck [line 2313]

string systemCheck( )

Checks to see if the current machine has php configured in a way Yioop! can run.



Tags:

return:  a message indicatign which required and optional components are missing; or "Passed" if nothing missing.


[ Top ]

method updateProfileFields [line 2901]

void updateProfileFields( &$data, &$profile, [ $check_box_fields = array()])



Parameters:

   &$data  
   &$profile  
   $check_box_fields  

[ Top ]


Documentation generated by phpDocumentor 1.4.3