$owner->ownerFlag = 1; $owner->inviteeName = $spUser->dbFields[first_name] . " " . $spUser->dbFields[last_name] ; // genereate that unique code $owner->generateInviteeCode(); $owner->create(); $owner->sendNotify(); return $msgs ; } put_headers(); // get db connect $data = CData_Layer::create($errors) ; // get the sess, auth and perm vars page_open (array("sess" => "phplib_Session_Pre_Auth", "auth" => "phplib_Pre_Auth", "perm" => "phplib_Perm")); ## do this in every file after the page_open $perm->check('USER'); if ($perm->have_perm('SUPER')) { change_domain(); }
/** * Attempts to return a reference to a concrete CData_Layer instance of name * $instance_name, only creating a new instance if no data_layer instance with * the same name currently exists. * * @param string $instance_name name of data_layer instance, if empty "auth_user" is used * @param array $errors array containing error messages * @return object CData_Layer instance of CData_Layer class * @static * @access public */ function &singleton($instance_name, &$errors) { static $instances = array(); global $sess_data_conn; if (!$instance_name) { $instance_name = "auth_user"; } if (!isset($instances[$instance_name])) { $instances[$instance_name] =& CData_Layer::create($errors); $instances[$instance_name]->name = $instance_name; } if (!isset($sess_data_conn[$instance_name])) { $sess_data_conn[$instance_name] = array('proxy' => null, 'db_dsn' => null, 'expire' => 0); } return $instances[$instance_name]; }
/** * Attempts to return a reference to a concrete CData_Layer instance of name * $instance_name, only creating a new instance if no data_layer instance with * the same name currently exists. * * @param string $instance_name name of data_layer instance, if empty "auth_user" is used * @return object CData_Layer instance of CData_Layer class * @static * @access public */ function &singleton($instance_name){ static $instances = array(); if (!$instance_name) $instance_name = "auth_user"; if (!isset($instances[$instance_name])){ $instances[$instance_name] = &CData_Layer::create(); $instances[$instance_name]->name = $instance_name; } if (!isset($_SESSION['data_conn'][$instance_name])) $_SESSION['data_conn'][$instance_name] = array('proxy' => null, 'db_dsn' => null); return $instances[$instance_name]; }