![]() |
|
twSblamPlugin - 0.0.3Antispam validator plugin |
|
![]() |
0
user
Sign-in
to change your status |
The |
Antispam validator plugin which use Sblam antispam system to validate message.
| Name | Status | |
|---|---|---|
|
|
lead | moc.liamg <<ta>> izdoluta |
The MIT License
Copyright (c) 2009-2010 Arkadiusz Tułodziecki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
| Version | License | API | Released |
|---|---|---|---|
| 0.0.3alpha | MIT license | 0.0.3alpha | 16/03/2010 |
| 0.0.2alpha | MIT license | 0.0.2alpha | 16/03/2010 |
| Version | License | API | Released |
|---|---|---|---|
| 0.0.3alpha | MIT license | 0.0.3alpha | 16/03/2010 |
| 0.0.2alpha | MIT license | 0.0.2alpha | 16/03/2010 |
| Version | License | API | Released |
|---|---|---|---|
| 0.0.3alpha | MIT license | 0.0.3alpha | 16/03/2010 |
| 0.0.2alpha | MIT license | 0.0.2alpha | 16/03/2010 |
The twSblamPlugin is antispam validator plugin. It uses Sblam antispam system to validate message.
Is much better front line check system than Captcha. Captcha can be used as second test when SBLAM will detect propably SPAM or SPAM.
Second test (Captcha) can be good option if users like to add lots of links to their posts for example.
Sblam project site is now only in Polish version but if someone help translate this site I think that lead developer of this project will be very happy.
You can use Sblam Validator class like normal Post Validator
class SblamTestForm extends sfForm {
public function configure() {
$this->setWidgets(array(
'name' => new sfWidgetFormInputText(),
'email' => new sfWidgetFormInputText(),
'message' => new sfWidgetFormTextarea(),
'www' => new sfWidgetFormInputText(),
));
$this->widgetSchema->setNameFormat('blogpost[%s]');
$this->setValidators(array(
'name' => new sfValidatorString(array('required' => false)),
'email' => new sfValidatorEmail(array('required' => false, 'trim' => true)),
'message' => new sfValidatorString(array('min_length' => 4, 'trim' => true)),
'www' => new sfValidatorUrl(array('required' => false, 'trim' => true)),
));
$this->validatorSchema->setPostValidator(new sfValidatorSblam(array('blogpost' => array('message', 'name', 'email', 'www')), 'zwxkS5pDST8v8qdd8e', sfValidatorSblam::PROBABLY_SPAM));
}
}
In upper example Validator will react where SBLAm returns sfValidatorSblam::PROBABLY_SPAM or sfValidatorSblam::SPAM (result >= 1)
You can chose list of types when Validator react's:
$this->validatorSchema->setPostValidator(new sfValidatorSblam(array('blogpost' => array('message', 'name', 'email', 'www')), 'zwxkS5pDST8v8qdd8e', array(sfValidatorSblam::SPAM, sfValidatorSblam::SERVER_ERROR)));
Possible parameters for sfValidatorSblam are:
class testformActions extends sfActions {
public function executeIndex(sfWebRequest $request) {
$this->form = new SblamTestForm();
if ($request->isMethod('post')) {
$this->form->bind($request->getParameter('blogpost'));
if ($this->form->isValid()) {
$this->redirect('testform/ok');
}
}
}
public function executeOk(sfWebRequest $request) {
}
}
