public function blqLogin() { $fbUserProfile = \core\wrapper\FacebookWrapper::getUserProfileFromRedirect(); $data = array('fb_id' => $fbUserProfile->getId(), 'login_type' => self::LOGIN_TYPE_FB, 'email' => $fbUserProfile->getEmail(), 'created' => date('Y-m-d H:i:s'), 'name' => $fbUserProfile->getName(), 'gender' => 'unisex', 'birth_date' => 'n/a', 'token' => null, 'email_confirmed' => true); $fbLogin = Ubermodel::getAll('fb_logins', array('WHERE' => array('fb_id' => $data['fb_id']))); if (empty($fbLogin)) { $this->addNewUser($data); } else { $this->_login($data); } header('Location: /index.php?page=Posts'); die; }
public function index($options = array()) { $data['Posts'] = Ubermodel::getAll($this->tableName); echo $this->renderView('Posts/index', compact('data')); }
public function apiView($args = array()) { //$user = Ubermodel::getOne('users', $args['column'], $args['data']); $user = Ubermodel::getAll('users', array('SELECT' => array('email', 'name', 'gender', 'birth_date'), 'WHERE' => array($args['column'] => $args['data']))); return $user; }