Permalink
Browse files

initial checkin

  • Loading branch information...
0 parents commit 82200c17018e022e9ca056621750a305982b393c @aarongustafson aarongustafson committed Dec 1, 2009
Showing with 166 additions and 0 deletions.
  1. +3 −0 CHANGELOG
  2. +23 −0 LICENSE
  3. +15 −0 README
  4. +116 −0 system/extensions/ext.login_on_registration.php
  5. +9 −0 system/language/english/lang.login_on_registration.php
@@ -0,0 +1,3 @@
+*v1.0* (2009-12-01)
+
+* Initial script
23 LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2008 Easy! Designs LLC
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
15 README
@@ -0,0 +1,15 @@
+== ext.login_on_registration.php
+
+ExpressionEngine extension that automatically logs a user in when they register.
+
+== Current Version
+
+1.0 (1 December 2009)
+
+== Requirements
+
+Solspace's User Module
+
+== License
+
+ext.easy_custom_fields.php is distributed under the liberal MIT License.
@@ -0,0 +1,116 @@
+<?php
+/*
+=====================================================
+ Login on Registration - by Easy! Designs, LLC
+-----------------------------------------------------
+ http://www.easy-designs.net/
+=====================================================
+ This extension was created by Aaron Gustafson
+ - aaron@easy-designs.net
+=====================================================
+ File: ext.login_on_registration.php
+-----------------------------------------------------
+ Purpose: Automatically logs a user in when registering
+=====================================================
+*/
+
+if( !defined( 'EXT' ) ){
+ exit('Invalid file request');
+}
+
+class Login_on_registration {
+ var $settings = array();
+
+ var $name = 'Login On Registration';
+ var $version = '1.0';
+ var $description = 'Logs a user in when they register';
+ var $settings_exist = 'n';
+ var $docs_url = '';
+
+ // -------------------------------
+ // Constructor
+ // -------------------------------
+ function Login_on_registration($settings=''){
+ $this->settings = $settings;
+ }
+ // END Akismet_check
+
+
+
+ // --------------------------------
+ // login
+ // --------------------------------
+ function login( $user_object, $member_id ){
+ # requires the User module
+ if( class_exists('User') === FALSE ){
+ require PATH_MOD.'user/mod.user'.EXT;
+ }
+ $U = new User();
+ # log in
+ $U->_remote_login();
+ }
+ // END login()
+
+ // --------------------------------
+ // Activate Extension
+ // --------------------------------
+
+ function activate_extension(){
+ global $DB;
+
+ $DB->query(
+ $DB->insert_string(
+ 'exp_extensions',
+ array(
+ 'extension_id' => '',
+ 'class' => __CLASS__,
+ 'method' => "login",
+ 'hook' => "user_register_end",
+ 'settings' => '',
+ 'priority' => 10,
+ 'version' => $this->version,
+ 'enabled' => "y"
+ )
+ )
+ ); // end db->query
+ }
+ // END activate_extension
+
+
+ // --------------------------------
+ // Update Extension
+ // --------------------------------
+ function update_extension($current=''){
+ global $DB, $PREFS;
+
+ //die($current);
+ if ($current == '' OR $current == $this->version)
+ {
+ return FALSE;
+ }
+
+ if ($current <= '1.0')
+ {
+ // Update to next version: 1.1
+ // Just a setting update...
+ }
+
+ $DB->query("UPDATE ".$PREFS->ini('db_prefix')."_extensions
+ SET version = '".$DB->escape_str($this->version)."'
+ WHERE class = '".__CLASS__."'");
+ }
+ // END update_extension
+
+ // --------------------------------
+ // Disable Extension
+ // --------------------------------
+ function disable_extension(){
+ global $DB, $PREFS;
+
+ $DB->query("DELETE FROM ".$PREFS->ini('db_prefix')."_extensions WHERE class = '".__CLASS__."'");
+ }
+ // END disable_extension
+
+}
+// END CLASS
+?>
@@ -0,0 +1,9 @@
+<?php
+
+$L = array(
+
+/* END */
+''=>''
+
+);
+?>

0 comments on commit 82200c1

Please sign in to comment.