Example #1
0
 function setFromRoo($ar, $roo)
 {
     $this->setFrom($ar);
     if (!empty($ar['passwd1'])) {
         $this->setPassword($ar['passwd1']);
     }
     if ($this->id && $this->email == $roo->old->email && $this->company_id == $roo->old->company_id) {
         return true;
     }
     if (empty($this->email)) {
         return true;
     }
     $xx = DB_Dataobject::factory($this->tableName());
     $xx->setFrom(array('email' => $this->email));
     if ($xx->count()) {
         return "Duplicate Email found";
     }
     return true;
 }
Example #2
0
 function _validateDatabase()
 {
     //echo "<PRE>"; print_r($this);
     if ($this->nodatabase) {
         return;
     }
     $options =& PEAR::getStaticProperty('DB_DataObject', 'options');
     $dd = empty($options['dont_die']) ? false : true;
     $options['dont_die'] = true;
     // database is the only setting - we dont support mult databses?
     $x = new DB_Dataobject();
     $x->_database = $this->database;
     if (PEAR::isError($err = $x->getDatabaseConnection())) {
         $this->fatalError("Configuration or Database Error: could not connect to Database, <BR>\n                    Please check the value given to HTML_FlexyFramework, or run with debug on!<BR>\n                     <BR> " . $err->toString());
     }
     // reset dont die!
     $options['dont_die'] = $dd;
 }