FormKey validation in Custom Form for Contacts

I have a custom form setup for my contacts module. I would like to implement a form key to prevent spam. Usually, the spammer directly uses the form post without having a session before. So form key seems to be a solution. But. I am having some problems implementing this.

This is my custom form in index.phtml where I have already added the hidden input “FormKey” before closing the form-tag:

            <form action="<?php echo $  this->getFormAction(); ?>" id="contactForm" method="post">             <div class="fieldset">                 <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>                 <ul class="form-list">                     <li class="fields">                         <div class="field">                             <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>                             <div class="input-box">                                 <input name="name" id="name" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Name')) ?>" value="<?php echo $  this->escapeHtml($  this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />                             </div>                         </div>                         <div class="field">                             <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>                             <div class="input-box">                                 <input name="email" id="email" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Email')) ?>" value="<?php echo $  this->escapeHtml($  this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />                             </div>                         </div>                     </li>                     <li>                         <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>                         <div class="input-box">                             <input name="telephone" id="telephone" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Telephone')) ?>" value="" class="input-text" type="text" />                          </div>                     </li>                     <li class="wide">                         <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>                          <div class="input-box">                             <textarea name="comment" id="comment" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Comment')) ?>" class="required-entry input-text" cols="5" rows="3"></textarea>                         </div>                     </li>                 </ul>             </div>             <?php echo $  this->getLayout()->createBlock('cms/block')->setBlockId('dsgvo')->toHtml(); ?>              <div>                 <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />                 <button type="submit" title="<?php echo Mage::helper('core')->quoteEscape(Mage::helper('contacts')->__('Submit')) ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>             </div>             <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />         </form> 

This is my Controller in IndexController.php

 <?php require_once "Mage/Contacts/controllers/IndexController.php";    class Centerfy_Contacts_IndexController extends Mage_Contacts_IndexController{     const XML_PATH_EMAIL_RECIPIENT  = 'contacts/email/recipient_email';     const XML_PATH_EMAIL_SENDER     = 'contacts/email/sender_email_identity';     const XML_PATH_EMAIL_TEMPLATE   = 'contacts/email/email_template';     const XML_PATH_ENABLED          = 'contacts/contacts/enabled';      public function preDispatch()     {         parent::preDispatch();          if( !Mage::getStoreConfigFlag(self::XML_PATH_ENABLED) ) {             $  this->norouteAction();         }     }      public function indexAction()     {         $  this->loadLayout();         $  this->getLayout()->getBlock('contactForm')         ->setFormAction( Mage::getUrl('*/*/post', array('_secure' => $  this->getRequest()->isSecure())) );          $  this->_initLayoutMessages('customer/session');         $  this->_initLayoutMessages('catalog/session');         $  this->renderLayout();     }      public function postAction()     {         $  post = $  this->getRequest()->getPost();         if ( $  post ) {             $  translate = Mage::getSingleton('core/translate');             /* @var $  translate Mage_Core_Model_Translate */             $  translate->setTranslateInline(false);             try {                 $  postObject = new Varien_Object();                 $  postObject->setData($  post);                  $  error = false;                  if (!Zend_Validate::is(trim($  post['name']) , 'NotEmpty')) {                     $  error = true;                 }                  if (!Zend_Validate::is(trim($  post['comment']) , 'NotEmpty')) {                     $  error = true;                 }                  if (!Zend_Validate::is(trim($  post['email']), 'EmailAddress')) {                     $  error = true;                 }                  if (Zend_Validate::is(trim($  post['hideit']), 'NotEmpty')) {                     $  error = true;                 }                     <?php echo $  this->getBlockHtml('formkey')?>                                if ($  error) {                     throw new Exception();                 }                 $  mailTemplate = Mage::getModel('core/email_template');                 /* @var $  mailTemplate Mage_Core_Model_Email_Template */                 $  mailTemplate->setDesignConfig(array('area' => 'frontend'))                 ->setReplyTo($  post['email'])                 ->setTemplateSubject(Mage::helper('contacts')->__('Contact Form'))                 ->sendTransactional(                         Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),                         Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),                         Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),                         null,                         array('data' => $  postObject)                 );                  if (!$  mailTemplate->getSentSuccess()) {                     throw new Exception();                 }                  $  translate->setTranslateInline(true);                  Mage::getSingleton('core/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));                 $  this->_redirect('*/*/');                  return;             } catch (Exception $  e) {                 $  translate->setTranslateInline(true);                  Mage::getSingleton('core/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));                 $  this->_redirect('*/*/');                 return;             }          } else {             $  this->_redirect('*/*/');         }     }  } 

How do I setup my controller to check the formkey against the session?

How to convert NBF file to VCF or extract contacts from NBF file?

What is a nbf file and how do I open a nbf file?
An NBF file is a backup of Nokia PC Suite phone data. It contains the address book, user settings, and other stored data, and can be used to restore or copy data. Nokia backup files are a copy of the phone data which is stored in supported Nokia mobile phones, and these Nokia backup files, which are implemented with encoding specifications are proprietary to Nokia. Encoding specifications are used for saving these NBF files in the…

How to convert NBF file to VCF or extract contacts from NBF file?

Generating a CSV file from all contacts in Outlook Directory

As part of a University, I have been assigned a University email. When I access my email through Outlook, and I go on the “People” section, I am able to access a section with all of the contacts in the University.

However, I am able to export as a CSV file only the contacts that I directly add to my contacts list.

The question is: how can I export all of the contacts in the directory without directly adding them to my contacts?

Sensible method to edit contacts on a Samsung phone?

Currently the Samsung app for Contacts is driving me nuts on my S9+.

I used to have my contacts entered as I wanted them into the Phone address book (only one other phone number on the SIM). But then the Contacts app started to pester me about wanting to merge contacts. Dismissing those notifications by touching that X in the top right of the notification window ended up removing the one contact that was most complete for my significant other (in a sense the master contact which also contained address, birthday, siblings and stuff, aside from the phone numbers). Instead I now have her Telegram and Skype contacts as a single entry in the Contacts app. Alas, that single entry cannot be edited, only deleted. But given the intransparent handling of this stuff, I’m really afraid to delete it, because it warns me that the contacts will disappear from where ever they are defined (so presumably deleting this one entry from Contacts will end up deleting the contacts in Telegram and Skype respectively).

Anyway, so I figured I’d simply start creating a new contact for the Phone app to use, even though the phone number was already mentioned in the combined Telegram and Skype entry.

Guess what, when I create a new entry it cannot be named the same as the existing one, even though the existing one cannot be edited. I’m out of words for how badly this software is designed …

How can I manage the contacts on my Samsung S9+ in a fashion that makes explicit where a contact is stored (i.e. where the respective data comes from), lets me merge them in either direction and lets me move them between the different address books of connected accounts (SIM, Phone, Google, mail provider)?

NB: I’d like to avoid any method involving syncing to Google or so …

android app makers – make 1000$ profit per app – outsource contacts provided

HOW IT WORKS

APP LAUNCH RESELLER

Anyone can run this Business, no design or sales experience necessary to run your own Mobile App Design and Development Business in this multi-million dollar niche encompassing the production of optimized Mobile Apps.

What happens when a sale takes place?

You will receive an email and payment via PayPal immediately when a customer places an order on the website. You then place an order with the Supplier to create the required App. Your Supplier…

android app makers – make 1000$ profit per app – outsource contacts provided

Samsung J7::I have several different “contact” Apps on my phone.. each a different color icon, each called “Contacts”. – which is which?

A long title I know, but if it were shorted, someone trying to help would probably make a wrong assumption without being so specific. I’m assuming that each different “Contact” list application, is associated to different email systems or different services that I use for Email? Every different “Contacts” App wants to control the world by merging into it, every piece of contact information it can find from other similar applications. My problem I don’t know which ICON is from which email vendor. Or otherwise saying: which “Contact” Icon refers to my Google, Yahoo, Microsoft, and Verizon accounts? I would like to standardize on something if I new which Icon belongs to who? For example I have a Red, Blue, and Orange colored Icon on my J7 home screen and don’t know whose belongs to who.

Third-party contact apps to backup contacts to Google from Samsung devices

The Contact apps that ships with Samsung devices does not seem to have a function to reliably backup all contacts on the phone and SIM storage to Google accounts.

Is there any third-party app that’d let me reliably do so? Bonus points if it’d let me sort which contact goes to which Google accounts registered on the device.

As a last resort, if there’s no such app, I don’t mind if I can get to backup to storage with which I can transfer the contacts to a different device.

PS I intentionally point to a specific model because I need to do so from two different Samsung devices and both their contact apps did not let me move all contacts to Google account. One of them does have .vcf export, but the other doesn’t. I want a more universal solution if at all possible.

PPS The device that can do .vcf export has Google accounts correctly setup on both the new and old devices but all contacts has not been synced, hence the question.

Samsung Contacts (version 10.1.02.20) not remembering default save location

Ever since about a few weeks ago, Samsung Contacts (currently on version 10.1.02.20) no longer remembers my default storage location for saving a new contact. Nowadays, whenever I tap the + icon on the bottom right, it asks me which account to save the contact to. I did add a new Google account to my phone a month ago, so the step would have been expected the first time, but now I’ve selected my preferred account and tapped “Set as default” multiple times. I definitely want to use only one specific account to manage my contacts (my personal Google account), so I don’t like having to select the account every time.

I would have thought that a lot of other people who use Samsung devices aren’t so clued up on why they should save their contacts to the cloud, so this type of complexity would certainly disadvantage people who aren’t careful about storing data in the cloud.

I have Android Pie on a Samsung Galaxy S8.