/**
  * making sure all variables ar mysql safe
  */
 function store()
 {
     if (function_exists('base64_serialize')) {
         $this->submission = base64_serialize($this->submission);
     }
     parent::store();
 }
 function byrd_create_user($username, $email, $password = false)
 {
     $_tbl =& bTable::getInstance('users', 'Table');
     if (!$password) {
         $password = byrd_generate_password(12, false);
     }
     //save this to the database
     $_tbl->bind(array('user_login' => $username, 'user_pass' => byrd_hash_password($password), 'user_nicename' => $username, 'user_email' => $email, 'user_registered' => date('Y-m-d H:i:s'), 'user_status' => 0, 'display_name' => $username));
     $_tbl->store();
     return $_tbl->ID;
 }
 /**
  * making sure all variables ar mysql safe
  */
 function store()
 {
     parent::store();
 }
Example #4
0
 /**
  * making sure all variables ar mysql safe
  */
 function store()
 {
     $this->payment_date = date('Y-m-d H:i:s', strtotime($this->payment_date));
     parent::store();
 }
Example #5
0
require_once dirname(__FILE__) . DS . 'helper.php';
ini_set('memory_limit', '200M');
if (!isset($wp_did_header)) {
    $wp_did_header = true;
    if (is_file(byrd_rootfolder(__FILE__) . DS . 'wp-load.php')) {
        require_once byrd_rootfolder(__FILE__) . DS . 'wp-load.php';
        require_once ABSPATH . WPINC . DS . 'template-loader.php';
    } else {
        trigger_error('Problem loading Wordpress Framework.');
    }
}
//loading resources
require_once dirname(__FILE__) . DS . 'request.php';
require_once dirname(__FILE__) . DS . 'object.php';
require_once dirname(__FILE__) . DS . 'capabilities.class.php';
require_once dirname(__FILE__) . DS . 'role.class.php';
require_once dirname(__FILE__) . DS . 'properties.php';
require_once dirname(__FILE__) . DS . 'configclass.php';
require_once dirname(__FILE__) . DS . 'siteclass.php';
require_once dirname(__FILE__) . DS . 'factory.php';
if (!class_exists('Email')) {
    require_once dirname(__FILE__) . DS . 'phpmail.php';
}
if (!function_exists('file_get_html')) {
    require_once dirname(__FILE__) . DS . 'simple_html_dom.php';
}
require_once ROL_DATABASE . DS . 'database.php';
require_once ROL_DATABASE . DS . 'table.php';
//make sure to add the db tables include path
bTable::addIncludePath(ROL_TABLES);
Example #6
0
 /**
  * making sure all variables ar mysql safe
  */
 function store()
 {
     $this->capabilities = base64_serialize($this->capabilities);
     parent::store();
     $this->capabilities = base64_unserialize($this->capabilities);
 }
Example #7
0
 /**
  * displays the form
  * @return none
  */
 function addRole()
 {
     $table =& bTable::getInstance($this->table, 'Table');
     $properties = $table->getProperties();
     echo '<form action="#" method="get" name="formadd" id="formadd">';
     //create the form
     foreach ($properties as $property => $value) {
         if ($table->getKeyName() == $property) {
             continue;
         }
         if ('capabilities' == $property) {
             continue;
         }
         $label = ucwords(strtolower(str_replace('_', ' ', $property)));
         echo '<label>' . $label . '<br>';
         echo '<input type="text" name="' . $property . '" id="' . $property . '"></label><br>';
     }
     echo '</form>';
 }
Example #8
0
 /**
  * Check if an item is checked out
  *
  * This function can be used as a static function too, when you do so you need to also provide the
  * a value for the $against parameter.
  *
  * @static
  * @access public
  * @param integer  $with  	The userid to preform the match with, if an item is checked out
  * 				  			by this user the function will return false
  * @param integer  $against 	The userid to perform the match against when the function is used as
  * 							a static function.
  * @return boolean
  */
 function isCheckedOut($with = 0, $against = null)
 {
     if (isset($this) && is_a($this, 'bTable') && is_null($against)) {
         $against = $this->get('checked_out');
     }
     //item is not checked out, or being checked out by the same user
     if (!$against || $against == $with) {
         return false;
     }
     $session =& bTable::getInstance('session');
     return $session->exists($against);
 }
 /**
  * gets the list of data
  * @return none
  */
 function viewform()
 {
     // getting the table reference
     $table =& bTable::getInstance($this->table, 'Table');
     //get the table
     $table->load($this->ID);
     echo $table->html;
 }
}
require_once dirname(__FILE__) . '/defines.php';
require_once dirname(__FILE__) . DS . 'helper.php';
ini_set('memory_limit', '200M');
if (!isset($wp_did_header)) {
    $wp_did_header = true;
    if (is_file(byrd_rootfolder(__FILE__) . DS . 'wp-load.php')) {
        require_once byrd_rootfolder(__FILE__) . DS . 'wp-load.php';
        require_once ABSPATH . WPINC . DS . 'template-loader.php';
    } else {
        trigger_error('Problem loading Wordpress Framework.');
    }
}
//loading resources
require_once dirname(__FILE__) . DS . 'request.php';
require_once dirname(__FILE__) . DS . 'object.php';
require_once dirname(__FILE__) . DS . 'properties.php';
require_once dirname(__FILE__) . DS . 'configclass.php';
require_once dirname(__FILE__) . DS . 'siteclass.php';
require_once dirname(__FILE__) . DS . 'factory.php';
if (!class_exists('Email')) {
    require_once dirname(__FILE__) . DS . 'phpmail.php';
}
if (!function_exists('file_get_html')) {
    require_once dirname(__FILE__) . DS . 'simple_html_dom.php';
}
require_once EXP_DATABASE . DS . 'database.php';
require_once EXP_DATABASE . DS . 'table.php';
//make sure to add the db tables include path
bTable::addIncludePath(EXP_TABLES);
 /**
  * making sure all variables ar mysql safe
  */
 function delete($email)
 {
     //set the query
     $query = "SELECT ID FROM " . $this->_tbl . " WHERE user_email = '" . $email . "'" . " LIMIT 1;";
     //set and run the query
     $this->_db->setQuery($query);
     $id = $this->_db->loadObject()->ID;
     parent::delete($id);
 }
Example #12
0
 /**
  * loads all user data from the cookie
  * 
  * @return bool
  */
 function loadUser()
 {
     //getting the users name
     if (!($this->username = byrd_getusername())) {
         return false;
     }
     //getting the user data
     $user =& bTable::getInstance('users', 'Table');
     $userdata = $user->username_exists($this->username);
     $this->user_id = $userdata['ID'];
     $user->load($this->user_id);
     //getting the users meta data
     $usermeta =& bTable::getInstance('usermeta', 'Table');
     $usermeta->user_id = $this->user_id;
     $usermetadata = $usermeta->getMeta();
     $userdata['meta'] = $usermetadata;
     //binding
     $this->loadMeta($usermetadata, 'word_user_level');
     $this->loadMeta($usermetadata, 'word_capabilities');
     //special binds
     $this->user_role = ucwords(key(unserialize($this->word_capabilities)));
     return $userdata;
 }
Example #13
0
    /**
     * returns the complete formatted subscriptions
     * <!-- getSubscription() -->
     * 
     * @param $content
     * @return unknown_type
     */
    function getSubscriptions()
    {
        $return = '';
        $sub =& bTable::getInstance('subscriptions', 'Table');
        if ($this->pp_sandbox) {
            $action = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
        } else {
            $action = 'https://www.paypal.com/cgi-bin/webscr';
        }
        if (!is_array($subscriptions = $sub->getList())) {
            return '<!-- No Subscriptions exist. -->';
        }
        foreach ($subscriptions as $sub) {
            $return .= '<h3>' . $sub['item_name'] . '</h3>
			<div class="left width75">' . $sub['item_description'] . '</div>
			<div class="left width25">$' . $sub['a3'] . '</div>
			<div class="clear"></div>
			
<div style="position:relative;float:right;"> 
 <form action="' . $action . '" method="post">
  <input type="hidden" name="cmd" value="_xclick-subscriptions">
  <input type="hidden" name="item_number" value="' . $sub['itemid'] . '">
    ';
            foreach ($this->getProperties() as $property => $value) {
                if (is_null($this->{$property}) || !$this->{$property}) {
                    continue;
                }
                if (in_array($property, array('role', 'item_number', 'status', 'downgradeuser', 'custom', 'displayexpirationdata', 'old_roles', 'wp_filter_id'))) {
                    continue;
                }
                $return .= '<input type="hidden" name="' . $property . '" value="' . $value . '"> ';
            }
            foreach ($sub as $property => $value) {
                if (is_null($sub[$property]) || !$sub[$property]) {
                    continue;
                }
                if (in_array($property, array('role', 'item_number', 'status', 'downgradeuser', 'custom', 'displayexpirationdata', 'old_roles', 'wp_filter_id'))) {
                    continue;
                }
                $return .= '<input type="hidden" name="' . $property . '" value="' . $value . '">';
            }
            $return .= ' 
    <input type="hidden" name="custom" value="' . $this->calc_expiration($sub['p3'], $sub['t3'], $sub['srt']) . '">
  <input type="submit" name="submit" value="' . $sub['buy_button'] . '" border="0" alt="PayPal - The safer, easier way to pay online">
  
 </form>
</div>
			<div style="display:block;width:100%;clear:both;height:1px;line-height:1px;"></div>';
        }
        return $return;
    }
Example #14
0
 /**
  * stores the submission to the database regardless
  * @return 
  */
 function storeUserData()
 {
     if (!isset($this->userid)) {
         return false;
     }
     update_usermeta($this->userid, 'subscription_expiration', $this->custom);
     update_usermeta($this->userid, 'subscription_startdate', $this->payment_date);
     update_usermeta($this->userid, 'subscription_name', $this->item_name);
     update_usermeta($this->userid, 'subscription_streetaddress', $this->address_street);
     update_usermeta($this->userid, 'subscription_city', $this->address_city);
     update_usermeta($this->userid, 'subscription_state', $this->address_state);
     update_usermeta($this->userid, 'subscription_zip', $this->address_zip);
     update_usermeta($this->userid, 'subscription_country', $this->address_country);
     update_usermeta($this->userid, 'first_name', $this->first_name);
     update_usermeta($this->userid, 'last_name', $this->last_name);
     $data['display_name'] = $this->first_name . ' ' . $this->last_name;
     $_tbl =& bTable::getInstance('users', 'Table');
     $_tbl->load($this->userid);
     $_tbl->bind($data);
     $_tbl->store();
 }