Item order in Site Settings -> Security Settings -> Anti-spam

Bug #702264 reported by Gregor Anželj
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Melissa Draper

Bug Description

Items are now ordered in alphabetical order, e.g. Advanced, None, Simple. Maybe it would be better to display them in ascending-measures order, e.g. None, Simple, Advanced

Changed in mahara:
milestone: none → 1.4.0
importance: Undecided → Low
status: New → Triaged
Changed in mahara:
status: Triaged → Confirmed
assignee: nobody → qwert33 (dominikschmid93)
status: Confirmed → In Progress
Revision history for this message
Dominik Schmid (dominikschmid93) wrote :
Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

Hi qwert33, you had to foresee your filename change in new_spam_trap function as well, it is using the old names.

The idea of using numbers to define the weight is not bad, though I would eliminate hyphens and would just leave the number, e.g. 00NoneSpamTrap.php

Revision history for this message
Dominik Schmid (dominikschmid93) wrote :

Use this patch instead of my previous one.

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

Would be great if someone else from dev-team could advice on it, using numbers in the file name for weightening the spam methods seems OK to me (it could be replaced with keeping the weight as constants in the files, but it will be difficult to maintain). If it is all right I will implement the patch after refactoring and add required config table update.

Revision history for this message
Sean Brennan (the-ioniser) wrote : Re: [Mahara-contributors] [Bug 702264] Re: Item order in Site Settings -> Security Settings -> Anti-spam

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would suggest removing the numbering scheme and go for a config file
that has an array of the files to use in the order to use them.

On 28/01/11 23:14, Ruslan Kabalin wrote:
> Would be great if someone else from dev-team could advice on it, using
> numbers in the file name for weightening the spam methods seems OK to me
> (it could be replaced with keeping the weight as constants in the files,
> but it will be difficult to maintain). If it is all right I will
> implement the patch after refactoring and add required config table
> update.
>

- --
Regards,
Sean Brennan

<email address hidden>
Cell:0274729712
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJNRdGXAAoJEBacL8dH3zIGolMP/3PFrKZWgtWNrWtjYaIHuhCZ
djkPvFeJTMA/bTxZfEe32rJODJFtlZGmYE1K6H1GbffvGgrEjrGJKRkb/qGoS91p
lXn+EkH0sdbw9Wo0v1X8uqpVahpMdikxA9/OfdScZ0EuJNIBa2YDftYmO2B3Wdf5
QJGLx+0vkJXa/aPcJEHw8LJVCBgglumzB8Z1Vtnnt7EZL7FWpmpvEZQE+bIM9nUT
ZnalYXkOkrWl64OyxbMt11XDaDaBxGDbbPTuKtg1gIro+4CO5vpZYh6s4fiHDDfy
cQvcm1Yz/0rvY0fhjppIOGPkq+Cs5Wh7DLNLKE+FxUMtvFu1DVSUh/ml5ozzHeXY
N4VOHMLy92QYshKDTunu+4oeTkNxedrTNKnKxFPhAeienV6xSStpIXcCnCB3z1tT
F8KnZNBjZyl0S4zmrO50+P4TwWxPpYLCYOBb4L3aZyosbYYoTlKeTQHvmR2sj279
n0dr8pt6LJOiYqfaEOi1pLzXdtLEwHYpMUX++9Ro5mLHQpsjXmr8LCcScd7+5mdV
gRoMPn5Ffuygo8DvfyLl+OtLweuYBU1K3LI6jTLYIV0eBTW/d4aixWRnuleuQDs+
PZH662k5sY5BCPLhb7XIhdZr2MMKPrijoX1zI0CW8qpl0RMxFiuR2sD/sVS0QA1w
9ZLOYUTQ/bS63Vdq2YtU
=7wW7
-----END PGP SIGNATURE-----

Revision history for this message
Richard Mansfield (richard-mansfield) wrote :

If the intention is to allow site admins to 'drop in' more antispam files and be able to order them as they like, then the default weights should leave gaps: maybe number them as 10, 20, 30 rather than 00, 01, 02. I don't think it's very likely that anyone would make use of this though, so it doesn't seem like a big advantage over just hardcoding the ordering somewhere in antispam.php.

If we really need to be able to drop in files with weights, then defining the weight inside each file seems better than filename ordering, but I don't care that much about it, and putting the weights in the files would mean the available_spam_traps function would have to be a bit more complicated and read the files in.

In the long run these existing spam classes could be rewritten a bit and given more descriptive names anyway. All the stuff in Simple to do with checking email addresses are well-formed, and checking that name and subject fields don't contain newlines could be moved into pieform rules that people could use to validate any field in any form. If we did that, there wouldn't be much left in Simple apart from counting URLs in body fields, and then it would make sense to change the names from Simple to 'Count URLs' and Advanced to 'Check blacklisted URLs' or something like that.

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

There is no obvious reason to define the weight at the moment, I just suggest using it for ordering. Defining it inside each fine might make things slightly complicated. Say, if we will have 8 different traps, adding one more will require checking the existing ones to find out which weight to define for the new one. Since spam traps are not changed too often, then probably keeping the array with the traps order in antispam.php sounds the most reasonable.

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

qwert33: will you have time to write the patch that would do what has been suggested above?

Revision history for this message
Dominik Schmid (dominikschmid93) wrote :

Hi,

I am currently writing form an internet cafe as I'm on holiday untill the 14th. I also moved my to a new workstation, so I'd have to re-setup my mahara (+patch).
Nevertheless, I'd be able to change this, although it would take a bit more time. =]

Just avoid confusion, the changes that need to be done are only to have the weighting (in the filenames) as 10, 20, ... , correct?

Also, I've just changed my displayed name (from qwert33) to be not arbitrary.

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

Hi Dominik,
No, this time the order should be defined as an array somewhere in antispam.php. The file names and the name of trap that we keep in the database should remain the same.

tags: added: antispam bite-sized
Changed in mahara:
assignee: Dominik Schmid (dominikschmid93) → nobody
status: In Progress → Confirmed
Melissa Draper (melissa)
Changed in mahara:
assignee: nobody → Melissa Draper (melissa)
Melissa Draper (melissa)
Changed in mahara:
status: Confirmed → In Progress
Melissa Draper (melissa)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.