Aliro Documentation : AntiSpamProtocol

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register

Revision [1186]

Most recent edit made on 2009-08-15 22:26:01 by MartinBrampton

Additions:
When a response to a captcha challenge is received from the user, it can be validated by this method/trigger. The response is true if the response is valid, or false if it is not. A plugin that does not implement a captcha service, or which has it deactivated, should always return true.


Deletions:
When a response to a captcha challenge is received from the user, it can be validated by this method/trigger. The response is true if the response is valid, or false if it is not.




Revision [1185]

Edited on 2009-08-15 22:10:16 by MartinBrampton

Additions:
Applications implemented in Aliro may need to check against spam. A variety of anti-spam services exist, such as Defensio, Stop Forum Spam and Mollom. At the time of writing, there are Aliro plugins for the first two of those. The services have different characteristics, both in respect of the API offered and the terms on which the service is offered. Given the variety of possible services and the unknown extent of applications that might use them, the obvious solution is to implement an anti-spam service as a plugin with a defined interface. The Aliro Anti-Spam Protocol is therefore a number of plugin triggers, each one having specific parameters and return values. An anti-spam plugin may not fully implement all of them, but must provide some response to each trigger. The triggers, their parameters and return values are listed below.
Aliro does not prevent there being multiple anti-spam plugins installed in a system. To make use of anti-spam services simpler for applications, Aliro provides a singleton class called aliroSpamHandler that provides a single interface for spam queries. This class then triggers whatever anti-spam plugins are present.
The Aliro spam handler (obtained by calling aliroSpamHandler::getInstance()) offers a method getSpamOptions() which returns an associative array. The keys are the possible spam status codes: ham, spam, unknown, unsure, profanity, unwanted, lowquality. The values are readable, translated equivalents for the codes. Actual anti-spam services will not understand or use all these values, and some are intended primarily for use by administrators to record the status of items.
The following describes the various interfaces. Most of them are the same either as a plugin trigger with parameters, or a method with parameters. The aliroSpamHandler class attempts to logically combine results from multiple plugins and to return a sensible result. Applications should use the aliroSpamHandler, and anti-spam plugins should implement the trigger interfaces.
This trigger or method is the main anti-spam operation. The more information is supplied, the better the anti-spam service will operate, but all items are optional. If the item is an edited version of something that has previously been checked, the identifier string for the item should be supplied. The title, body, authorName, authorURI, authorEmail, authorIP, authorOpenID are self explanatory. The authorID is the usual user ID for the author, zero for a visitor. Where the item is a comment on an article, the articlePermalink and the articleDate (as a unix time stamp) should be provided. Finally, if the last parameter is set to true, the item is assumed to be from a trusted author, such as a site administrator.
The return from the trigger is an associative array with the following values:
Note that the method does not return the 'checker' value, but otherwise returns a combined result using the same format.
Not all spam services will implement this, although the trigger should still be provided. It allows an application to tell the spam service about an article on which comments will be invited. The parameters are self explanatory. The method is the same as the trigger.
changeSpamStatus ($identifier, $oldStatus, $newStatus) - trigger
changeSpamStatus ($identifier, $newStatus) - method
Where an administrator takes a different view from the anti-spam service, it should be communicated back to the service. The services do not accept feedback on all possible transitions, and it is the responsibility of the plugin to decide which ones to send to the service. Administrators must take care over status changes, as they can affect future operation of the anti-spam service. The identifier must be the same string that was received from an earlier checkContentForSpam operation. Note that the trigger provides both the old and new status, whereas the method in aliroSpamHandler only requires the new status, as it obtains the old status from its own spam log. Bear in mind that the spam log is only kept for a short period (7 days by default) so spam status changes will not reach the anti-spam service unless they are made promptly.
Not all anti-spam services will support this, so it is up to the application to check whether the result is an empty string. If the option is supported, then for an item that has previously been checked and given an identifier, a spam image can be requested. The return will be valid HTML that can be embedded in a page, or a null string if the facility is not implemented. Plugins that implement the captcha interface should have a parameter that allows this service to be switched on and off, so that in the case where multiple installed plugins could provide the service, the administrator can select one of them by switching it on, with others turned off. The class aliroSpamHandler returns only the first response received from plugins.
Likewise, not all anti-spam services will support this, but where supported it will return a string of valid HTML that links to a spoken version of a captcha for the item given by the identifier string. Otherwise, the return will be a null string. The principles of operation are similar to the previous trigger/method.
checkSpamCaptcha ($identifier, $solution)
When a response to a captcha challenge is received from the user, it can be validated by this method/trigger. The response is true if the response is valid, or false if it is not.
getCheckerIdentifier ($identifier, $checkername) - method only
Each anti-spam service may have its own identifier for an item that is checked. The aliroSpamHandler class creates its own identifer for each item, but also stores the individual identifiers in the database. This method is provided to aid implementation of plugins, which are sent the aliroSpamHandler identifier where an identifier is needed (this is inevitable, since a trigger cannot specify different parameters for different plugins, but can only specify a single set of parameters). The overall identifier can be converted to an individual service's identifier using this method, and providing the overall identifier and the name of the particular service, as returned to the checkContentForSpam trigger.


Deletions:
Applications implemented in Aliro may need to check against spam. A variety of anti-spam services exist, such as Defensio and Mollom. They have different characteristics, both in respect of the API offered and the terms on which the service is offered. Given the variety of possible services and the unknown extent of applications that might use them, the obvious solution is to implement an anti-spam service as a plugin with a defined interface. The Aliro Anti-Spam Protocol is therefore a number of plugin triggers, each one having specific parameters and return values. An anti-spam plugin may not fully implement all of them, but must provide some response to each trigger. The triggers, their parameters and return values are listed below.
Aliro does not prevent there being multiple anti-spam plugins installed in a system. It is therefore up to the application to decide what strategy to adopt in handling the array of return values that will come from each trigger. The simplest strategy is to use only the first element of the array.
The Aliro request object (obtained by calling aliroRequest::getInstance() or accessible through $this in an application that uses the standard Aliro application structure) offers a method getSpamOptions() which returns an associative array. The keys are the possible spam status codes: ham, spam, unknown, unsure, profanity, unwanted, lowquality. The values are readable, translated equivalents for the codes. Actual anti-spam services will not understand or use all these values, and some are intended primarily for use by administrators to record the status of items.
This trigger is the main anti-spam operation. The more information is supplied, the better the anti-spam service will operate, but all items are optional. If the item is an edited version of something that has previously been checked, the identifier string for the item should be supplied. The title, body, authorName, authorURI, authorEmail, authorIP, authorOpenID are self explanatory. The authorID is the usual user ID for the author, zero for a visitor. Where the item is a comment on an article, the articlePermalink and the articleDate (as a unix time stamp) should be provided. Finally, if the last parameter is set to true, the item is assumed to be from a trusted author, such as a site administrator.
The return from this trigger is an associative array with the following values:
Not all spam services will implement this, although the trigger should still be provided. It allows an application to tell the spam service about an article on which comments will be invited. The parameters are self explanatory.
changeSpamStatus ($identifier, $oldStatus, $newStatus)
Where an administrator takes a different view from the anti-spam service, it should be communicated back to the service. The services do not accept feedback on all possible transitions, and it is the responsibility of the plugin to decide which ones to send to the service. Administrators must take care over status changes, as they can affect future operation of the anti-spam service. The identifier must be the same string that was received from an earlier checkContentForSpam operation.
Not all anti-spam services will support this, so it is up to the application to check whether the result is an empty string. If the option is supported, then for an item that has previously been checked and given an identifier, a spam image can be requested. The return will be valid HTML that can be embedded in a page, or a null string if the facility is not implemented.
Likewise, not all anti-spam services will support this, but where supported it will return a string of valid HTML that links to a spoken version of a captcha for the item given by the identifier string. Otherwise, the return will be a null string.
there must be a verification trigger




Revision [1184]

Edited on 2009-08-15 21:27:40 by MartinBrampton

Additions:
checkContentForSpam ($identifier='', $title='', $body='', $authorName='', $authorURI='', $authorEmail='', $authorIP='', $authorOpenID='', $authorID=0, $articlePermalink='', $articleDate=0, $trusted=false)
announceArticleForComments ($authorName='', $authorEmail='', $title='', $body='', $articlePermalink='')


Deletions:
checkContentForSpam ($identifier='', $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorIP=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)
announceArticleForComments ($authorName=, $authorEmail=, $title=, $body=, $articlePermalink=)




Revision [1183]

Edited on 2009-08-15 21:25:25 by MartinBrampton

Additions:
checkContentForSpam ($identifier='', $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorIP=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)


Deletions:
checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorIP=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)




Revision [1181]

Edited on 2009-07-24 09:56:16 by MartinBrampton

Additions:
checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorIP=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)
This trigger is the main anti-spam operation. The more information is supplied, the better the anti-spam service will operate, but all items are optional. If the item is an edited version of something that has previously been checked, the identifier string for the item should be supplied. The title, body, authorName, authorURI, authorEmail, authorIP, authorOpenID are self explanatory. The authorID is the usual user ID for the author, zero for a visitor. Where the item is a comment on an article, the articlePermalink and the articleDate (as a unix time stamp) should be provided. Finally, if the last parameter is set to true, the item is assumed to be from a trusted author, such as a site administrator.


Deletions:
checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)
This trigger is the main anti-spam operation. The more information is supplied, the better the anti-spam service will operate, but all items are optional. If the item is an edited version of something that has previously been checked, the identifier string for the item should be supplied. The title, body, authorName, authorURI, authorEmail, authorOpenID are self explanatory. The authorID is the usual user ID for the author, zero for a visitor. Where the item is a comment on an article, the articlePermalink and the articleDate (as a unix time stamp) should be provided. Finally, if the last parameter is set to true, the item is assumed to be from a trusted author, such as a site administrator.




Revision [174]

Edited on 2009-07-09 17:20:55 by MartinBrampton

Additions:
checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)


Deletions:
checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)




Revision [129]

The oldest known version of this page was edited on 2009-05-04 08:14:34 by MartinBrampton

Aliro Anti-Spam Protocol


Applications implemented in Aliro may need to check against spam. A variety of anti-spam services exist, such as Defensio and Mollom. They have different characteristics, both in respect of the API offered and the terms on which the service is offered. Given the variety of possible services and the unknown extent of applications that might use them, the obvious solution is to implement an anti-spam service as a plugin with a defined interface. The Aliro Anti-Spam Protocol is therefore a number of plugin triggers, each one having specific parameters and return values. An anti-spam plugin may not fully implement all of them, but must provide some response to each trigger. The triggers, their parameters and return values are listed below.

Aliro does not prevent there being multiple anti-spam plugins installed in a system. It is therefore up to the application to decide what strategy to adopt in handling the array of return values that will come from each trigger. The simplest strategy is to use only the first element of the array.

The Aliro request object (obtained by calling aliroRequest::getInstance() or accessible through $this in an application that uses the standard Aliro application structure) offers a method getSpamOptions() which returns an associative array. The keys are the possible spam status codes: ham, spam, unknown, unsure, profanity, unwanted, lowquality. The values are readable, translated equivalents for the codes. Actual anti-spam services will not understand or use all these values, and some are intended primarily for use by administrators to record the status of items.

checkContentForSpam ($identifier=, $title=, $body=, $authorName=, $authorURI=, $authorEmail=, $authorOpenID=, $authorID=0, $articlePermalink=, $articleDate=0, $trusted=false)

This trigger is the main anti-spam operation. The more information is supplied, the better the anti-spam service will operate, but all items are optional. If the item is an edited version of something that has previously been checked, the identifier string for the item should be supplied. The title, body, authorName, authorURI, authorEmail, authorOpenID are self explanatory. The authorID is the usual user ID for the author, zero for a visitor. Where the item is a comment on an article, the articlePermalink and the articleDate (as a unix time stamp) should be provided. Finally, if the last parameter is set to true, the item is assumed to be from a trusted author, such as a site administrator.

The return from this trigger is an associative array with the following values:

announceArticleForComments ($authorName=, $authorEmail=, $title=, $body=, $articlePermalink=)

Not all spam services will implement this, although the trigger should still be provided. It allows an application to tell the spam service about an article on which comments will be invited. The parameters are self explanatory.

changeSpamStatus ($identifier, $oldStatus, $newStatus)

Where an administrator takes a different view from the anti-spam service, it should be communicated back to the service. The services do not accept feedback on all possible transitions, and it is the responsibility of the plugin to decide which ones to send to the service. Administrators must take care over status changes, as they can affect future operation of the anti-spam service. The identifier must be the same string that was received from an earlier checkContentForSpam operation.

getSpamImageCaptcha ($identifier)

Not all anti-spam services will support this, so it is up to the application to check whether the result is an empty string. If the option is supported, then for an item that has previously been checked and given an identifier, a spam image can be requested. The return will be valid HTML that can be embedded in a page, or a null string if the facility is not implemented.

getSpamAudioCaptcha ($identifier)

Likewise, not all anti-spam services will support this, but where supported it will return a string of valid HTML that links to a spoken version of a captcha for the item given by the identifier string. Otherwise, the return will be a null string.

there must be a verification trigger
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.1827 seconds