>>> Sentry::user_exists("what's up"); Notice - Undefined index: id in PKGPATH/sentry/classes/sentry/user.php on line 108 true >>> Sentry::user_exists(9494949494234) Notice - Undefined index: id in PKGPATH/sentry/classes/sentry/user.php on line 108 true >>> Sentry::user_exists(false) trueThere are also a lot of weird inconsistencies, like getters that return associative arrays instead of model instances or methods that don't throw exceptions when the documentation claims they should. Anyway, I'm sure it'll all be fixed in time, but it might be worth holding off for now.
Harro Verton wrote on Thursday 29th of December 2011:For most issues there are pull requests waiting. Be patient, Cartalyst is closed over the holiday's, dpetrie mentioned that on IRC...
-bash-3.00$ php oil r migrate --packages=sentry Error - SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' with query: "CREATE TABLE IF NOT EXISTS `` ( `id` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, ... `activated` tinyint NOT NULL, PRIMARY KEY `id` (`id`) ) DEFAULT CHARACTER SET utf8;" in COREPATH/classes/database/pdo/connection.php on line 137
class Model_User extends \Orm\Model { // set table name manually // even tho it will magically map to 'users' protected static $_table_name = 'users'; // set metadata relation protected static $_has_one = array('metadata' => array( 'key_from' => 'id', 'model_to' => 'Model_User_Metadata', 'key_to' => 'user_id', )); // set available properties protected static $_properties = array( 'id', 'email' ); }
class Model_User_Metadata extends \Orm\Model { // set table name manually since we are using Sentry protected static $_table_name = 'users_metadata'; // metadata belongs to user protected static $_belongs_to = array( 'user' => array( 'key_from' => 'user_id', ) ); // map metadata protected static $_properties = array( 'first_name', 'last_name' ); }
$data['members'] = Model_User::find('all', array( 'related' => array('metadata') ));
class Model_User_Metadata extends \Orm\Model { // set table name manually since we are using Sentry protected static $_table_name = 'users_metadata'; // the primary key in this case is user_id protected static $_primary_key = array('user_id'); // metadata belongs to user protected static $_belongs_to = array('user'); // map metadata protected static $_properties = array( 'user_id', 'first_name', 'last_name' ); }
Harro Verton wrote on Wednesday 18th of January 2012:ORM requires an auto_increment primary key. You may call it what you like, but 'id' is preferred. You can just add it to the metadata table. As its value is auto generated, it won't bother Sentry, but it allows the ORM model to work on both tables.
'always_load' => array( /** * These packages are loaded on Fuel's startup. You can specify them in * the following manner: * * array('auth'); // This will assume the packages are in PKGPATH * * // Use this format to specify the path to the package explicitly * array( * array('auth' => PKGPATH.'auth/') * ); */ 'packages' => array( 'orm', 'sentry', ),hope this will help,...
Rafael Hegina wrote on Wednesday 4th of January 2012:@jasonjudge, i encountered same issue,. i fix it by, editing config and adding sentry to the always load...
Harro Verton wrote on Wednesday 4th of January 2012:I don't see this to be an oil bug.
public function action_activate($login_value = null, $code = null) { try { $activate = Sentry::activate_user($login_value,$code); if ($activate) { Session::set_flash('success', 'your account is now active'); } else { Session::set_flash('error', 'there was an error activating this account'); } } catch (SentryAuthException $e) { // issue activating the user // store/set and display caught exceptions such as a suspended user with limit attempts feature. $errors = $e->getMessage(); Session::set_flash('error', $errors); } // Response::redirect(); }
It looks like you're new here. If you want to get involved, click one of these buttons!