示例#1
0
	public function save_importer() {
		$miID = $this->post('miID');
		$mi = MailImporter::getByID($miID);
		if (is_object($mi)) {
			$mi->update($this->post());
			$this->redirect('/dashboard/settings/mail', 'importer_updated');
		}
	}
示例#2
0
 public function save_importer()
 {
     if (!Loader::helper('validation/token')->validate('save_importer')) {
         $this->error->add(t('Invalid Token.'));
         return;
     }
     $miID = $this->post('miID');
     $mi = MailImporter::getByID($miID);
     if (is_object($mi)) {
         $mi->update($this->post());
         $this->redirect('/dashboard/system/mail/importers', 'importer_updated');
     }
 }
示例#3
0
	public function add($args, $pkg = null) {
		$db = Loader::db();
		extract($args);
		
		if ($miPort < 1) {
			$miPort = 0;
		}
		
		if ($miIsEnabled != 1) {
			$miIsEnabled = 0;
		}
		
		if ($miEncryption == '') {
			$miEncryption == null;
		}
		
		$pkgID = ($pkg == null) ? 0 : $pkg->getPackageID();
		
		$db->Execute('insert into MailImporters (miHandle, miServer, miUsername, miPassword, miEncryption, miIsEnabled, miEmail, miPort, pkgID) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', 
			array(
				$miHandle,
				$miServer,
				$miUsername,
				$miPassword,
				$miEncryption,
				$miIsEnabled,
				$miEmail, 
				$miPort, 
				$pkgID
			));
		
		$miID = $db->Insert_ID();
		return MailImporter::getByID($miID);
	}
示例#4
0
 public function add($args, $pkg = null)
 {
     $db = Loader::db();
     extract($args);
     if ($miPort < 1) {
         $miPort = 0;
     }
     if ($miIsEnabled != 1) {
         $miIsEnabled = 0;
     }
     if ($miEncryption == '') {
         $miEncryption == null;
     }
     if (!$miConnectionMethod) {
         $miConnectionMethod = 'POP';
     }
     $pkgID = $pkg == null ? 0 : $pkg->getPackageID();
     $db->Execute('insert into MailImporters (miHandle, miServer, miUsername, miPassword, miEncryption, miIsEnabled, miEmail, miPort, miConnectionMethod, pkgID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', array($miHandle, Loader::helper('security')->sanitizeString($miServer), $miUsername, $miPassword, $miEncryption, $miIsEnabled, Loader::helper('security')->sanitizeString($miEmail), $miPort, $miConnectionMethod, $pkgID));
     $miID = $db->Insert_ID();
     return MailImporter::getByID($miID);
 }