Įrašai su žyma „InEnglish“

Codeigniter form with integrated data and file validation

In one application built on Codeigniter framework I needed to create a special form. The form had to allow a user to both enter text data and upload an image. It was actually the first time I had any experience with programming forms that would include file upload. And I found out it is not a completely trivial task in Codeigniter. There are multiple reasons for this, but the main one is this: image validation and form data validation are done separately in Codeigniter. Not only the validation is done by two different classes, but the error messages are also independent.

So I went on to create a form that would integrate both types of validation (or rather, the error messages). On the way I had to decide on one major usability problem: what to do with image if the user submits the right image but the rest of the form does not validate (for example, forgets to enter name or email). I decided to go with the simplest option – the image is discarded, and the user is warned to not forget to attach the image again (since the file upload field cannot be repopulated, as other fields can be).

Admittedly, the image could be saved to save user the trouble of attaching it again, but in that case you have to solve another problem – what to do with the images that the user (a malicious user) submits and subsequently fails to submit the properly filled in form. I know, something could be done at the browser level using Javascript validation, but the server-side validation is still necessary… Toliau skaityti Codeigniter form with integrated data and file validation

Lithuanian Supreme Court Ignores Strasbourg Genocide Judgment

The Plenary Session of the Supreme Court of Lithuania (SCL) adopted on April 12, 2016, the final ruling in a case in which a former KGB officer, Stanislovas Drėlingas, was accused of being an accomplice in genocide, and sentenced for this crime both by the trial court and the appeals court.

Drėlingas was prosecuted for his participation in a KGB operation that resulted in the capture of one of the last leaders of the Lithuanian partisan resistance to the Soviet rule. The active resistance to the Soviet occupation in Lithuania was crushed in 1953, and no large stale repressions were implemented by the Soviet authorities since the death of Stalin the same year, but some of the partisans remained in hiding. One of the leaders of partisans Adolfas Ramanauskas and his wife Birutė Mažeikaitė were living with forged documents for about three years, when they were taken by the KGB in the mentioned operation. Allegedly, Adolfas Ramanauskas was subsequently tortured, and in the next year he was sentenced to death by the Supreme Court of the Lithuanian Soviet Socialist Republic. Adolfas Ramanauskas was sentenced for the killing of soviet citizens during his time as a leader of the partisans, whom the soviet authorities did not consider as lawful combatants. His wife was sentenced to eight years in prison, of which she served two years.

Drėlingas, although an officer of the KGB, was not the leader of the operation, and he was not found to be among those who arrested the former partisans; neither was he charged with torture or other inhumane acts. He was indicted and sentenced for genocide of Lithuanian partisans, part of “national-ethnic-political group.”

On April 12, the plenary session of the Supreme Court of Lithuania, composed of 17 judges of the criminal law division of the court, unanimously upheld the previous judgment, that Drėlingas was guilty as a participant in the genocide directed at Lithuanian partisans, a separate political group, who were held to have been a substantial part of Lithuanian nation or ethnic Lithuanians, thus a protected by the Genocide Convention of 1948.

Toliau skaityti Lithuanian Supreme Court Ignores Strasbourg Genocide Judgment