Merge branch '2013.03' into 2013.10
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Feb 2014 12:19:55 +0000 (13:19 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Feb 2014 12:19:55 +0000 (13:19 +0100)
Conflicts:
tine20/Tinebase/Setup/Update/Release7.php
tine20/Tinebase/Setup/setup.xml

16 files changed:
tests/tine20/Tinebase/User/RegistrationTest.php [deleted file]
tine20/Tinebase/Export/Abstract.php
tine20/Tinebase/Export/Spreadsheet/Xls.php
tine20/Tinebase/Frontend/Http.php
tine20/Tinebase/Frontend/Json/UserRegistration.php [deleted file]
tine20/Tinebase/Server/Json.php
tine20/Tinebase/Setup/Update/Release8.php
tine20/Tinebase/Setup/setup.xml
tine20/Tinebase/User/Registration.php [deleted file]
tine20/Tinebase/User/Sql.php
tine20/Tinebase/js/UserRegistration.js [deleted file]
tine20/Tinebase/views/activate.php [deleted file]
tine20/Tinebase/views/lostpwMailHtml.php [deleted file]
tine20/Tinebase/views/lostpwMailPlain.php [deleted file]
tine20/Tinebase/views/registrationMailHtml.php [deleted file]
tine20/Tinebase/views/registrationMailPlain.php [deleted file]

diff --git a/tests/tine20/Tinebase/User/RegistrationTest.php b/tests/tine20/Tinebase/User/RegistrationTest.php
deleted file mode 100644 (file)
index 74f3b11..0000000
+++ /dev/null
@@ -1,263 +0,0 @@
-<?php
-/**
- * Tine 2.0 - http://www.tine20.org
- * 
- * @package     Tinebase
- * @subpackage  User
- * @license     http://www.gnu.org/licenses/agpl.html
- * @copyright   Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
- * @author      Philipp Schuele <p.schuele@metaways.de>
- */
-
-/**
- * Test helper
- */
-require_once dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'TestHelper.php';
-
-if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Tinebase_User_RegistrationTest::main');
-}
-
-/**
- * Test class for Tinebase_User
- */
-class Tinebase_User_RegistrationTest extends PHPUnit_Framework_TestCase
-{
-    /**
-     * @var array test objects
-     */
-    protected $objects = array();
-
-    /**
-     * @var user data for registration
-     */
-    protected $userData = array();
-
-    /**
-     * @var user data for registration with email
-     */
-    protected $userDataMail = array();
-    
-    /**
-     * Runs the test methods of this class.
-     *
-     * @access public
-     * @static
-     */
-    public static function main()
-    {
-        $suite  = new PHPUnit_Framework_TestSuite('Tinebase_User_RegistrationTest');
-        PHPUnit_TextUI_TestRunner::run($suite);
-    }
-
-    /**
-     * Sets up the fixture.
-     * This method is called before a test is executed.
-     *
-     * @access protected
-     */
-    protected function setUp()
-    {
-        $this->userData =  array(
-            'accountEmailAddress' => 'p.schuele@metaways.de',
-            'accountFirstName' => 'Philipp',
-            'accountLastName' => 'Test',
-            'accountLoginName' => 'ptest',
-        );
-
-        $this->userDataMail =  array(
-            'accountEmailAddress' => 'p.schuele@metaways.de',
-            //'accountEmailAddress' => 'test@example.org',
-            'accountFirstName' => 'Philippo',
-            'accountLastName' => 'Testet',
-            'accountLoginName' => 'ptestet',
-        );
-        
-        $this->objects['registration'] = new Tinebase_Model_Registration ( array(
-            'email' => $this->userData['accountEmailAddress'],
-            'login_hash' => md5($this->userData['accountLoginName']),
-            'login_name' => $this->userData['accountLoginName'],
-        ));
-
-        $this->objects['registrationDummy'] = new Tinebase_Model_Registration ( array(
-            'email' => 'test@example.org',
-            'login_hash' => md5('dummy_test'),
-            'login_name' => 'dummy_test',
-        ));
-        
-        return;
-        
-
-    }
-
-    /**
-     * Tears down the fixture
-     * This method is called after a test is executed.
-     *
-     * @access protected
-     */
-    protected function tearDown()
-    {
-    }
-
-    /**
-     * try to register a user
-     *
-     * @todo reactivate 'expires'-test
-     */
-    public function testRegisterUser()
-    {
-
-        // don't send mail
-        $result = Tinebase_User_Registration::getInstance()->registerUser( $this->userData, false );
-        
-        // check account
-        $account = Tinebase_User::getInstance()->getFullUserByLoginName( $this->userData['accountLoginName'] );
-        
-        $this->assertEquals( $account->accountLastName,  $this->userData['accountLastName'] );
-        
-        // check if "expires" in config.ini set to 0 before this check 
-        /*
-        try {
-            // get config
-            $config = new Zend_Config_Ini($_SERVER['DOCUMENT_ROOT'] . '/../config.ini', 'registration');
-        } catch (Zend_Config_Exception $e) {
-            Zend_Registry::get('logger')->debug(__METHOD__ . '::' . __LINE__ . ' no config for registration found! '. $e->getMessage());
-        }
-
-        if ( isset($config->expires) && $config->expires > 0) {
-           $this->assertNotEquals( NULL, $account->accountExpires, "account expires" );
-        } else {
-           $this->assertEquals( NULL, $account->accountExpires, "account won't expire" );
-        }
-        */
-        
-        // check registration
-        $registration = Tinebase_User_Registration::getInstance()->getRegistrationByHash($this->objects['registration']->login_hash);
-
-        $this->assertEquals( $registration->email,  $this->objects['registration']->email, "email address is not the same" );
-           $this->assertEquals( 0, $registration->email_sent, "email sent" );
-        // check config settings
-           
-    }    
-
-    /**
-     * try to register a user with email
-     *
-     */
-    public function testRegisterUserSendMail()
-    {
-        // disabled for the moment
-        /*
-        // send mail
-        $result = Tinebase_User_Registration::getInstance()->registerUser ( $this->userDataMail );
-
-        $this->assertEquals(  $result, true );
-        
-        // check registration
-        $registration = Tinebase_User_Registration::getInstance()->getRegistrationByHash(md5($this->userDataMail['accountLoginName']));
-
-        $this->assertEquals(  $registration->email_sent,1 );
-        */                
-    }
-
-   /**
-     * try to update a registration
-     *
-     */
-    public function testUpdateRegistration()
-    {
-        
-        // check registration update
-        $registration = Tinebase_User_Registration::getInstance()->getRegistrationByHash(md5($this->userData['accountLoginName']));
-        
-        $updatedRegistration = Tinebase_User_Registration::getInstance()->updateRegistration($registration);
-        
-        $this->assertEquals(  $registration->date,$updatedRegistration->date );
-        $this->assertEquals(  $registration->status,$updatedRegistration->status );
-        
-    }
-    
-    /**
-     * try to check if a username is unique
-     *
-     */
-    public function testCheckUniqueUsername()
-    {
-         $result = Tinebase_User_Registration::getInstance()->checkUniqueUsername($this->objects['registration']->login_name);
-         
-         $this->assertEquals( $result, false );
-
-         $result = Tinebase_User_Registration::getInstance()->checkUniqueUsername($this->objects['registrationDummy']->login_name);
-         
-         $this->assertEquals( $result, true );
-    } 
-
-    
-    /**
-     * try to register a user
-     *
-     * @todo     implement & activate & check result
-     */
-    public function testSendLostPasswordMail()
-    {
-        //$result = Tinebase_User_Registration::getInstance()->sendLostPasswordMail ( $this->objects['registration']->login_name );
-        //$this->markTestIncomplete('This test has not been implemented yet.');
-    }    
-    
-    /**
-     * try to activate an account
-     *
-     */
-    public function testActivateAccount()
-    {
-        $result = Tinebase_User_Registration::getInstance()->activateUser( $this->objects['registration']->login_hash );
-
-        // check account
-        $account = Tinebase_User::getInstance()->getFullUserByLoginName( $this->userData['accountLoginName'] );
-        
-        $this->assertEquals( $account->accountExpires, NULL );
-    }    
-
-    
-    /**
-     * try to delete a registration
-     *
-     */
-    public function testDeleteRegistrationByLoginName()
-    {
-        // delete registration
-        Tinebase_User_Registration::getInstance()->deleteRegistrationByLoginName ( $this->objects['registration']->login_name );
-
-        // delete account afterwards
-        $account = Tinebase_User::getInstance()->getUserByLoginName($this->objects['registration']->login_name, 'Tinebase_Model_FullUser');
-        Tinebase_User::getInstance()->deleteUser( $account );
-        
-        // delete email account
-           // delete registration
-           /*
-        Tinebase_User_Registration::getInstance()->deleteRegistrationByLoginName ( $this->userDataMail['accountLoginName'] );
-
-        // delete account afterwards
-        $account = Tinebase_User::getInstance()->getUserByLoginName($this->userDataMail['accountLoginName'], 'Tinebase_Model_FullUser');
-        Tinebase_User::getInstance()->deleteUser( $account );
-        */        
-    }
-    
-    /**
-     * try to fetch a non-existant registration
-     *
-     */
-    public function testGetNonExistantRegistration()
-    {
-        $this->setExpectedException('Tinebase_Exception_Record_NotDefined');
-        
-        $registration = Tinebase_User_Registration::getInstance()->getRegistrationByHash(md5($this->userData['accountLoginName']));
-    }
-    
-}        
-    
-
-if (PHPUnit_MAIN_METHOD == 'Tinebase_User_RegistrationTest::main') {
-    Tinebase_User_RegistrationTest::main();
-}
index b67e4e3..7b23ea8 100644 (file)
@@ -223,13 +223,26 @@ abstract class Tinebase_Export_Abstract
                 'getRelations' => $this->_getRelations,
             ),
         ));
+        
         $result = $iterator->iterate();
         
+        $this->_onAfterExportRecords($result);
+        
         if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ 
             . ' Exported ' . $result['totalcount'] . ' records.');
     }
     
     /**
+     * template method, gets called after _exportRecords
+     * 
+     * @param array $result
+     */
+    protected function _onAfterExportRecords($result)
+    {
+        
+    }
+    
+    /**
      * resolve records and prepare for export (set user timezone, ...)
      *
      * @param Tinebase_Record_RecordSet $_records
index 4acd570..bb16267 100644 (file)
@@ -227,6 +227,19 @@ class Tinebase_Export_Spreadsheet_Xls extends Tinebase_Export_Spreadsheet_Abstra
     }
     
     /**
+     * (non-PHPdoc)
+     * @see Tinebase_Export_Abstract::_onAfterExportRecords()
+     */
+    protected function _onAfterExportRecords($result)
+    {
+        // save number of records (only if we have more than 1 sheets / records are on the second sheet by default)
+        if ($this->_excelObject->getSheetCount() > 1) {
+            $this->_excelObject->setActiveSheetIndex(0);
+            $this->_excelObject->getActiveSheet()->setCellValueByColumnAndRow(5, 2, $result['totalcount']);
+        }
+    }
+    
+    /**
      * add body rows
      *
      * @param Tinebase_Record_RecordSet $records
@@ -263,11 +276,5 @@ class Tinebase_Export_Spreadsheet_Xls extends Tinebase_Export_Spreadsheet_Abstra
             $i++;
             $this->_currentRowIndex++;
         }
-        
-        // save number of records (only if we have more than 1 sheets / records are on the second sheet by default)
-        if ($this->_excelObject->getSheetCount() > 1) {
-            $this->_excelObject->setActiveSheetIndex(0);
-            $this->_excelObject->getActiveSheet()->setCellValueByColumnAndRow(5, 2, count($_records));
-        }
     }
 }
index 38c723e..1843468 100644 (file)
@@ -629,48 +629,6 @@ class Tinebase_Frontend_Http extends Tinebase_Frontend_Http_Abstract
 
         return gmdate("D, d M Y H:i:s", $timeStamp) . " GMT";
     }
-    
-    /**
-     * activate user account
-     *
-     * @param     string $id
-     * 
-     */
-    public function activateUser( $id ) 
-    {
-        // update registration table and get username / account values
-        $account = Tinebase_User_Registration::getInstance()->activateUser( $id );
-
-        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' activated account for ' . $account['accountLoginName']);
-        
-        $view = new Zend_View();
-        $view->title="Tine 2.0 User Activation";
-        $view->username = $account['accountLoginName'];
-        $view->loginUrl = $_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
-
-        $view->setScriptPath('Tinebase/views');
-        
-        header('Content-Type: text/html; charset=utf-8');
-        echo $view->render('activate.php');
-    
-    }
-    
-    /**
-     * show captcha
-     *
-     * @todo    add to user registration process
-     */
-    public function showCaptcha () 
-    {
-        $captcha = Tinebase_User_Registration::getInstance()->generateCaptcha();
-        
-        //Tell the browser what kind of file is come in
-        header("Content-Type: image/jpeg");
-
-        //Output the newly created image in jpeg format
-        ImageJpeg($captcha);
-        
-    }
 
     /**
      * receives file uploads and stores it in the file_uploads db
diff --git a/tine20/Tinebase/Frontend/Json/UserRegistration.php b/tine20/Tinebase/Frontend/Json/UserRegistration.php
deleted file mode 100644 (file)
index 26cbe36..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-/**
- * Tine 2.0
- * 
- * @package     Tinebase
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @copyright   Copyright (c) 2007-2009 Metaways Infosystems GmbH (http://www.metaways.de)
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * 
- */
-
-/**
- * Json Container class
- * 
- * - handles the ajax requests and the json data
- * - calls the functions of class Tinebase_User_Registration
- * 
- * @package     Tinebase
- */
-class Tinebase_Frontend_Json_UserRegistration
-{
-    /**
-     * suggests a username
-     *
-     * @param     array $regData        data from registration frontend
-     * @return     string
-     * 
-     * @todo     add other methods for building username (move to js later on)
-     *             get method from config (email, firstname+lastname, other strings)?
-     * @todo     replace special chars in username
-     */
-    public function suggestUsername($regData) 
-    {
-        // build username from firstname (first char) & lastname
-        $firstname = (isset($regData['accountFirstName'])) ? substr($regData['accountFirstName'], 0, 1) : '';
-        $lastname = (isset($regData['accountLastName'])) ? $regData['accountLastName'] : '';
-        $suggestedUsername = $firstname.$lastname;
-        
-        return $suggestedUsername;
-    }
-
-    /**
-     * checks if username is unique
-     *
-     * @param     string $username
-     * @return     bool
-     * 
-     */
-    public function checkUniqueUsername($username) 
-    {
-        return Tinebase_User_Registration::getInstance()->checkUniqueUsername($username);
-    }
-
-    /**
-     * registers a new user
-     *
-     * @param     array $regData         json data from registration frontend
-     * @return     bool
-     * 
-     */
-    public function registerUser($regData) 
-    {
-        return Tinebase_User_Registration::getInstance()->registerUser($regData);
-    }    
-
-}
index b5678b6..e9e9150 100644 (file)
@@ -207,7 +207,6 @@ class Tinebase_Server_Json extends Tinebase_Server_Abstract implements Tinebase_
             
             // add json apis which require no auth
             $classes['Tinebase_Frontend_Json'] = 'Tinebase';
-            $classes['Tinebase_Frontend_Json_UserRegistration'] = 'Tinebase_UserRegistration';
             
             // register additional Json apis only available for authorised users
             if (Zend_Session::isStarted() && Zend_Auth::getInstance()->hasIdentity()) {
@@ -294,7 +293,6 @@ class Tinebase_Server_Json extends Tinebase_Server_Abstract implements Tinebase_
         $classes = array();
         
         $classes['Tinebase_Frontend_Json'] = 'Tinebase';
-        $classes['Tinebase_Frontend_Json_UserRegistration'] = 'Tinebase_UserRegistration';
         
         if (Tinebase_Core::isRegistered(Tinebase_Core::USER)) {
             $classes['Tinebase_Frontend_Json_Container'] = 'Tinebase_Container';
@@ -336,7 +334,7 @@ class Tinebase_Server_Json extends Tinebase_Server_Abstract implements Tinebase_
             'Tinebase.setLocale'
         );
         // check json key for all methods but some exceptions
-        if ( !(in_array($method, $anonymnousMethods) || preg_match('/Tinebase_UserRegistration/', $method))  
+        if ( !(in_array($method, $anonymnousMethods))
                 && $jsonKey != Tinebase_Core::get('jsonKey')) {
         
             if (! Tinebase_Core::isRegistered(Tinebase_Core::USER)) {
index a918ba3..d205135 100644 (file)
@@ -41,4 +41,22 @@ class Tinebase_Setup_Update_Release8 extends Setup_Update_Abstract
         $this->setTableVersion('timemachine_modlog', '3');
         $this->setApplicationVersion('Tinebase', '8.1');
     }
+
+    /**
+     * update to 8.2
+     * 
+     * @see 0009644: remove user registration
+     */
+    public function update_1()
+    {
+        if ($this->_backend->tableExists('registrations')) {
+            $this->dropTable('registrations');
+        }
+        
+        if ($this->_backend->tableExists('registration_invitation')) {
+            $this->dropTable('registration_invitation');
+        }
+        
+        $this->setApplicationVersion('Tinebase', '8.2');
+    }
 }
index acac696..db024cb 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <application>
     <name>Tinebase</name>
-    <version>8.1</version>
+    <version>8.2</version>
     <tables>
         <table>
             <name>applications</name>
                 </index>
             </declaration>
         </table>
-
-        <table>
-            <name>registrations</name>
-            <version>2</version>
-            <declaration>
-                <field>
-                    <name>id</name>
-                    <type>integer</type>
-                    <autoincrement>true</autoincrement>
-                </field>
-                <field>
-                    <name>login_name</name>
-                    <type>text</type>
-                    <length>64</length>
-                    <notnull>true</notnull>
-                </field>
-                <field>
-                    <name>login_hash</name>
-                    <type>text</type>
-                    <length>32</length>
-                    <notnull>true</notnull>
-                </field>
-                <field>
-                    <name>email</name>
-                    <type>text</type>
-                    <length>128</length>
-                    <notnull>true</notnull>
-                </field>
-                <field>
-                    <name>date</name>
-                    <type>datetime</type>
-                </field>
-                <field>
-                    <name>status</name>
-                    <type>text</type>
-                    <length>32</length>
-                    <value>activated</value>
-                    <notnull>true</notnull>
-                </field>
-                <field>
-                    <name>expires_at</name>
-                    <type>datetime</type>
-                </field>
-                <field>
-                    <name>email_sent</name>
-                    <type>boolean</type>
-                    <default>false</default>
-                </field>
-                <index>
-                    <name>account_id</name>
-                    <primary>true</primary>
-                    <field>
-                        <name>id</name>
-                    </field>
-                </index>
-                <index>
-                    <name>login_name</name>
-                    <unique>true</unique>
-                    <field>
-                        <name>login_name</name>
-                    </field>
-                </index>
-            </declaration>
-        </table>
-
-        <table>
-            <name>registration_invitation</name>
-            <version>2</version>
-            <declaration>
-                <field>
-                    <name>id</name>
-                    <type>text</type>
-                    <length>40</length>
-                    <notnull>true</notnull>
-                </field>
-                <field>
-                    <name>email</name>
-                    <type>text</type>
-                    <length>128</length>
-                    <notnull>true</notnull>
-                </field>
-                <index>
-                    <name>id</name>
-                    <primary>true</primary>
-                    <field>
-                        <name>id</name>
-                    </field>
-                </index>
-                <index>
-                    <name>email</name>
-                    <unique>true</unique>
-                    <field>
-                        <name>email</name>
-                    </field>
-                </index>
-            </declaration>
-        </table>
-
         <table>
             <name>container</name>
             <version>8</version>
diff --git a/tine20/Tinebase/User/Registration.php b/tine20/Tinebase/User/Registration.php
deleted file mode 100644 (file)
index c4d3e8f..0000000
+++ /dev/null
@@ -1,502 +0,0 @@
-<?php
-/**
- * Tine 2.0
- * 
- * @package     Tinebase
- * @subpackage  User
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * 
- */
-/**
- * User Registration class (singleton pattern)
- * 
- * @package     Tinebase
- * @subpackage  User
- */
-class Tinebase_User_Registration
-{
-    /**
-     * @var Zend_Db_Adapter_Pdo_Mysql
-     */
-    protected $_db;
-        
-    /**
-     * the registrations table
-     *
-     * @var Tinebase_Db_Table
-     */
-    protected $_registrationsTable;
-    
-    /**
-     * the invitations table
-     *
-     * @var Tinebase_Db_Table
-     */
-    protected $_invitationsTable;
-    
-    /**
-     * the config
-     *
-     * @var Zend_Config_Ini 
-     */
-    private $_config = NULL;
-    
-    /**
-     * the constructor
-     *
-     * don't use the constructor. use the singleton 
-     */
-    private function __construct ()
-    {
-        // get config
-        if(isset(Tinebase_Core::getConfig()->registration)) {
-            $this->_config = Tinebase_Core::getConfig()->registration;
-        } else {
-            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' no config for registration found! ');
-        }
-        // create table objects and get db adapter
-        $this->_registrationsTable = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'registrations'));
-        $this->_invitationsTable = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'registration_invitation'));
-        $this->_db = Tinebase_Core::getDb();
-    }
-    
-    /**
-     * don't clone. Use the singleton.
-     *
-     */
-    private function __clone ()
-    {
-    }
-    
-    /**
-     * holds the instance of the singleton
-     *
-     * @var Tinebase_User_Sql
-     */
-    private static $_instance = NULL;
-    /**
-     * the singleton pattern
-     *
-     * @return Tinebase_User_Registration
-     */
-    public static function getInstance ()
-    {
-        if (self::$_instance === NULL) {
-            self::$_instance = new Tinebase_User_Registration();
-        }
-        return self::$_instance;
-    }
-    
-    /**
-     * checks if username is unique
-     *
-     * @param   string  $_username
-     * @return  bool    true if username is unique
-     * 
-     */
-    public function checkUniqueUsername ($_username)
-    {
-        // if exists -> return false
-        return !Tinebase_User::getInstance()->userNameExists($_username);
-    }
-    
-    /**
-     * checks if email is in invitations table
-     *
-     * @param   string  $_email
-     * @return  bool    true if email is in invitations table
-     * @todo    add to tests
-     */
-    public function checkInvitation($_email)
-    {
-        $where = $this->_db->quoteInto($this->_db->quoteIdentifier('email') . ' = ?', $_email);
-        if ($row = $this->_invitationsTable->fetchRow($where)) {
-            // remove from table
-            $this->_invitationsTable->delete($where);
-            $result = true;
-        } else {
-            $result = false;
-        }
-        
-        return $result;
-    }
-    
-    /**
-     * registers a new user
-     *
-     * @param   array   $regData        json data from registration frontend
-     * @param   bool    $_sendMail      send registration mail
-     * @return  bool
-     * 
-     */
-    public function registerUser ($regData, $_sendMail = true)
-    {
-        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-            ' call registerUser with regData: ' . print_r($regData, true));
-        
-        // validate unique username
-        //@todo     move to frontend later on
-        if (! $this->checkUniqueUsername($regData['accountLoginName'])) {
-            throw (new Exception('Your chosen username already exists!'));
-        }
-        
-        // validate email address
-        if (isset($this->_config->emailValidation) && $this->_config->emailValidation == 'zend') {
-            // zend email validation isn't working on a 64bit os at the moment (v1.5.0)
-            require_once 'Zend/Validate/EmailAddress.php';
-            $validator = new Zend_Validate_EmailAddress();
-            if ($validator->isValid($regData['accountEmailAddress']) == false) {
-                // email is invalid; print the reasons
-                $debugMessage = 'Invalid registration email address: ' . $regData['accountEmailAddress'] . '( ';
-                foreach ($validator->getMessages() as $message) {
-                    $debugMessage .= $message . " ";
-                }
-                $debugMessage .= ')';
-                // throw exception
-                throw (new Exception('Invalid registration email address: ' . $debugMessage));
-            }
-        }
-        
-        // check invitation
-        //@todo     move to frontend later on
-        if (isset($this->_config->invitationOnly) 
-            && $this->_config->invitationOnly == 1 
-            && !$this->checkInvitation($regData['accountEmailAddress'])) {
-            throw (new Exception('Invalid registration email address (not invited)!'));
-        }
-        
-        // add more required fields to regData
-        // get default values from config if available
-        $regData['accountStatus'] = (isset($this->_config->accountStatus)) ? 
-            $this->_config->accountStatus : 'enabled';
-        $regData['accountDisplayName'] = $regData['accountFirstName'] . 
-            ' ' . $regData['accountLastName'];
-        $regData['accountFullName'] = $regData['accountDisplayName'];
-        // get groupbyname
-        $primaryGroupName = (isset($this->_config->accountPrimaryGroup)) ? 
-            $this->_config->accountPrimaryGroup : 'Users';
-        $primaryGroup = Tinebase_Group::getInstance()->getGroupByName($primaryGroupName);
-        $regData['accountPrimaryGroup'] = $primaryGroup->getId();
-        // add expire date (user has 1 day to click on the activation link)
-        if (isset($this->_config->expires) && $this->_config->expires > 0) {
-            $regData['accountExpires'] = new Tinebase_DateTime();
-            // add 'expires' from config hours
-            $timeToAdd = $this->_config->expires . ":00:00";
-            TinebaseCore::getLogger()->debug("this account expires in $timeToAdd hours ...");
-            $regData['accountExpires']->add($this->_config->expires, Tinebase_DateTime::MODIFIER_HOUR);
-        } else {
-            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug("this account never expires.");
-            $regData['accountExpires'] = NULL;
-        }
-        // get model & save user data (account & contact) via the User and Addressbook controllers
-        $account = new Tinebase_Model_FullUser($regData);
-        Tinebase_User::getInstance()->addUser($account);
-        Tinebase_Group::getInstance()->addGroupMember($account->accountPrimaryGroup, $account);
-        
-        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-            ' saved user ' . $regData['accountLoginName']);
-        // generate password and save it
-        $regData['password'] = $this->generatePassword();
-        Tinebase_User::getInstance()->setPassword($regData['accountLoginName'], 
-            $regData['password'], $regData['password']);
-        // create hash from username
-        $regData['accountLoginNameHash'] = md5($regData['accountLoginName']);
-        // save in registrations table 
-        $registration = new Tinebase_Model_Registration(array(
-            "login_name" => $regData['accountLoginName'] , 
-            "login_hash" => $regData['accountLoginNameHash'] , 
-            "email" => $regData['accountEmailAddress'])
-        );
-        $registration = $this->addRegistration($registration);
-        // send mail?
-        if ($_sendMail) {
-            $result = $this->sendRegistrationMail($regData, $registration);
-        } else {
-            $result = true;
-        }
-        return $result;
-    }
-
-    /**
-     * create user hash, send registration mail and save registration in database
-     *
-     * @param   array $_regData
-     * @param   Tinebase_Model_Registration $_registration
-     * @return  bool
-     *
-     * @access  protected
-     * 
-     */
-    protected function sendRegistrationMail ($_regData, $_registration)
-    {
-        $registration = $_registration;
-        $updateRegistration = false;
-        $mail = new Tinebase_Mail('UTF-8');
-        $mail->setSubject("Welcome to Tine 2.0");
-        $recipientName = $_regData['accountDisplayName'];
-        $recipientEmail = $_regData['accountEmailAddress'];
-        $hashedUsername = $_regData['accountLoginNameHash'];
-        // get plain and html message from views
-        // @todo translate mail texts
-        $view = new Zend_View();
-        $view->setScriptPath(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'views');
-        // set texts and values
-        $view->mailTextWelcome = "Welcome to Tine 2.0";
-        // if expires = 0 -> no activation link in email
-        if (isset($this->_config->expires) && $this->_config->expires > 0 && isset($_SERVER['SERVER_NAME'])) {
-            $view->mailActivationLink = 'http://' . $_SERVER['SERVER_NAME'] . 
-                $_SERVER['PHP_SELF'] . '?method=Tinebase.activateUser&id=' . 
-                $hashedUsername;
-            // deactivate registration
-            $registration->status = 'waitingforactivation';
-            $updateRegistration = true;
-        }
-        $view->username = $_regData['accountLoginName'];
-        $view->password = $_regData['password'];
-        $messagePlain = $view->render('registrationMailPlain.php');
-        $mail->setBodyText($messagePlain);
-        $messageHtml = $view->render('registrationMailHtml.php');
-        if ($messageHtml !== NULL) {
-            $mail->setBodyHtml($messageHtml);
-        }
-        $mail->addHeader('X-MailGenerator', 'Tine 2.0');
-        $mail->setFrom('webmaster@tine20.org', 'Tine 2.0 Webmaster');
-        $result = false;
-        if (! empty($recipientEmail)) {
-            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-                ' send registration email to ' . $recipientEmail);
-            $mail->addTo($recipientEmail, $recipientName);
-            if ($mail->send()) {
-                // update registration table with "mail sent"
-                $registration->email_sent = 1;
-                $updateRegistration = true;
-                $result = true;
-            }
-        }
-        if ($updateRegistration) {
-            $this->updateRegistration($registration);
-        }
-        return $result;
-    }
-
-    /**
-     * send lost password mail
-     *
-     * @param   string $_username
-     * @return  bool
-     * 
-     * @todo    add more texts to mail views & translate mails
-     */
-    public function sendLostPasswordMail ($_username)
-    {
-        // get full user
-        $fullAccount = Tinebase_User::getInstance()->getFullUserByLoginName($_username);
-        // generate new password
-        $newPassword = $this->generatePassword();
-        // save new password in user
-        Tinebase_Auth::getInstance()->setPassword($_username, $newPassword, $newPassword);
-        // send lost password mail      
-        $mail = new Tinebase_Mail('UTF-8');
-        $mail->setSubject("New password for Tine 2.0");
-        // get name from user
-        //$recipientName = $fullAccount->accountFirstName." ".$fullAccount->accountLastName;
-        $recipientName = $fullAccount->accountFullName;
-        // get email from user
-        $recipientEmail = $fullAccount->accountEmailAddress;
-        // get plain and html message from views
-        //-- translate text and insert correct link
-        $view = new Zend_View();
-        $view->setScriptPath(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'views');
-        $view->mailTextWelcome = "We generated a new password for you ...";
-        $view->newPassword = $newPassword;
-        $messagePlain = $view->render('lostpwMailPlain.php');
-        $mail->setBodyText($messagePlain);
-        $messageHtml = $view->render('lostpwMailHtml.php');
-        if ($messageHtml !== NULL) {
-            $mail->setBodyHtml($messageHtml);
-        }
-        $mail->addHeader('X-MailGenerator', 'Tine 2.0');
-        $mail->setFrom('webmaster@tine20.org', 'Tine 2.0 Webmaster');
-        if (! empty($recipientEmail)) {
-            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-                ' send lost password email to ' . $recipientEmail);
-            $mail->addTo($recipientEmail, $recipientName);
-            $mail->send();
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * generate new random password [a-zA-z0-9]
-     *
-     * @param   int $length
-     * @return  string
-     * 
-     * @access  private
-     */
-    private function generatePassword ($length = 8)
-    {
-        $password = "";
-        for ($i = 0; $i < $length; $i ++) {
-            $rdnum = mt_rand(0, 61);
-            if ($rdnum < 10) {
-                $password .= $rdnum;
-            } else if ($rdnum < 36) {
-                $password .= chr($rdnum + 55);
-            } else {
-                $password .= chr($rdnum + 61);
-            }
-        }
-        return $password;
-    }
-    
-    /**
-     * activate user
-     *
-     * @param   string $_loginHash
-     * @return  Tinebase_Model_FullUser
-     * 
-     */
-    public function activateUser($_loginHash)
-    {
-        // get registration by hash
-        $registration = $this->getRegistrationByHash($_loginHash);
-        // set new status in DB (registration)
-        $registration->status = 'activated';
-        $this->updateRegistration($registration);
-        // get user by username
-        $account = Tinebase_User::getInstance()->getFullUserByLoginName($registration['login_name']);
-        // set new expire_date in DB (user)
-        Tinebase_User::getInstance()->setExpiryDate($account['accountId'], NULL);
-        return $account;
-    }
-
-    /**
-     * generate captcha
-     *
-     * @return  image   the captcha image
-     * 
-     * @todo    save security code in db/session
-     */
-    public function generateCaptcha ()
-    {
-        // get security code (use password generator)
-        $securityCode = $this->generatePassword(4);
-        //Set the image width and height
-        $width = 120;
-        $height = 20;
-        // Create the image resource
-        $image = ImageCreate($width, $height);
-        // get colors, black background, set security code, add some lines
-        $white = ImageColorAllocate($image, 255, 255, 255);
-        $black = ImageColorAllocate($image, 0, 0, 0);
-        $grey = ImageColorAllocate($image, 204, 204, 204);
-        ImageFill($image, 0, 0, $black);
-        ImageString($image, 4, 40, 4, $securityCode, $white);
-        ImageRectangle($image, 0, 0, $width - 1, $height - 1, $grey);
-        imageline($image, 0, $height / 2, $width, $height / 2, $grey);
-        imageline($image, $width / 2, 0, $width / 2, $height, $grey);
-        return $image;
-    }
-
-    /********************************************************************
-     * SQL functions follow
-     */
-    
-    /**
-     * add new registration
-     *
-     * @param   Tinebase_Model_Registration $_registration
-     * @return  Tinebase_Model_Registration the new registration object
-     * 
-     * @access  protected
-     */
-    protected function addRegistration ($_registration)
-    {
-        if (! $_registration->isValid()) {
-            throw (new Exception('invalid registration object'));
-        }
-        $registrationData = array(
-            "login_name" => $_registration->login_name ,
-            "login_hash" => $_registration->login_hash ,
-            "email"      => $_registration->email ,
-            "date"       => Tinebase_DateTime::now()->get(Tinebase_Record_Abstract::ISO8601LONG),
-            "status"     => "justregistered"
-        );
-        // add new user
-        $this->_registrationsTable->insert($registrationData);
-        return $this->getRegistrationByHash($_registration->login_hash);
-    }
-    
-    /**
-     * update registration
-     *
-     * @param   Tinebase_Model_Registration $_registration
-     * @return  Tinebase_Model_Registration the updated registration object
-     * 
-     */
-    public function updateRegistration (Tinebase_Model_Registration $_registration)
-    {
-        if (! $_registration->isValid()) {
-            throw (new Exception('invalid registration object'));
-        }
-        $registrationData = array(
-            "login_name" => $_registration->login_name ,
-            "login_hash" => $_registration->login_hash ,
-            "email"      => $_registration->email ,
-            "date"       => ($_registration->date instanceof DateTime ? 
-                                $_registration->date->get(Tinebase_Record_Abstract::ISO8601LONG) : NULL) ,
-            "status"     => $_registration->status ,
-            "email_sent" => $_registration->email_sent);
-        //--   
-        $where = array($this->_registrationsTable->getAdapter()->quoteInto($this->_db->quoteIdentifier('id') . ' = ?', $_registration->id));
-        $result = $this->_registrationsTable->update($registrationData, $where);
-        return $this->getRegistrationByHash($_registration->login_hash);
-    }
-
-    /**
-     * delete registration by username
-     *
-     * @param   string $_username
-     * @return  int     number of rows affected
-     */
-    public function deleteRegistrationByLoginName ($_username)
-    {
-        $where = $this->_db->quoteInto($this->_db->quoteIdentifier('login_name') . ' = ?', $_username);
-        $result = $this->_registrationsTable->delete($where);
-        return $result;
-    }
-
-    /**
-     * get registration by hash
-     *
-     * @param string $_hash the hash (md5 coded username) from the registration mail
-     * @return Tinebase_Model_Registration the registration object
-     *
-     */
-    public function getRegistrationByHash ($_hash)
-    {
-        $select = $this->_db->select()->from(SQL_TABLE_PREFIX . 'registrations')->where($this->_db->quoteIdentifier('login_hash') . ' = ?', $_hash);
-        $stmt = $select->query();
-        $row = $stmt->fetch(Zend_Db::FETCH_ASSOC);
-        if ($row === false) {
-            throw (new Tinebase_Exception_Record_NotDefined('registration entry not found error'));
-        } 
-        if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-            "Tinebase_Model_Registration::row values: \n" . print_r($row, true));
-        try {
-            $registration = new Tinebase_Model_Registration();
-            $registration->setFromArray($row);
-        } catch (Exception $e) {
-            $validationErrors = $registration->getValidationErrors();
-            if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ .
-                $e->getMessage() . "\n" . "Tinebase_Model_Registration::validation_errors: \n" . 
-                print_r($validationErrors, true));
-            throw ($e);
-        }
-        return $registration;
-    }
-}
index f98cbeb..a8827dd 100644 (file)
@@ -904,7 +904,6 @@ class Tinebase_User_Sql extends Tinebase_User_Abstract
         $accountsTable          = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'accounts'));
         $groupMembersTable      = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'group_members'));
         $roleMembersTable       = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'role_accounts'));
-        $userRegistrationsTable = new Tinebase_Db_Table(array('name' => SQL_TABLE_PREFIX . 'registrations'));
         
         try {
             $transactionId = Tinebase_TransactionManager::getInstance()->startTransaction($this->_db);
@@ -928,7 +927,6 @@ class Tinebase_User_Sql extends Tinebase_User_Abstract
             $where  = array(
                 $this->_db->quoteInto($this->_db->quoteIdentifier('login_name') . ' = ?', $user->accountLoginName),
             );
-            $userRegistrationsTable->delete($where);
             
             Tinebase_TransactionManager::getInstance()->commitTransaction($transactionId);
         } catch (Exception $e) {
diff --git a/tine20/Tinebase/js/UserRegistration.js b/tine20/Tinebase/js/UserRegistration.js
deleted file mode 100644 (file)
index 4927dfc..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Tine 2.0
- * 
- * @package     Tine
- * @subpackage  Tinebase
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Cornelius Weiss <c.weiss@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- */
-Ext.ns('Tine', 'Tine.Tinebase');
-
-/**
- * @namespace   Tine.Tinebase
- * @class       Tine.Tinebase.UserRegistration
- * @extends     Ext.Window
- */
-Tine.Tinebase.UserRegistration = Ext.extend(Ext.Window, {
-    name: 'userRegistration',
-    
-    //layout: 'card',
-    //activeItem: 0,
-    layout: 'fit',
-    width: 400,
-    height: 400,
-    /**
-     * holds reg form (card layout)
-     */
-    regForm: false,
-    registrationData: {},
-    
-    /**
-     * @private
-     */
-    initComponent: function() {
-        this.items = [this.getWizard()];
-        this.title = _('Registration Wizard');
-        Tine.Tinebase.UserRegistration.superclass.initComponent.call(this);
-        
-    },
-    /**
-     * is that used?
-     */
-    navHandler: function(button) {
-        var direction = 1;
-        if (button.id == 'move-prev') {
-            direction = -1;
-        }
-        var cl = Ext.getCmp('UserRegistrationCardLayout');
-        //cl.setActiveItem(cl.activeItem + direction);
-        //console.log(cl);
-        //this.getRegForm().setActiveItem(this.regFrom.activeItem + direction);
-    },
-    
-    getSuggestedUsername: function() {
-        Ext.Ajax.request({
-            url: 'index.php',
-            //method: POST, (should not be required)
-            params: {
-                method: 'Tinebase_UserRegistration.suggestUsername',
-                regData: this.registrationData
-            },
-            
-            success: function(result, request) {
-                Ext.getCmp('accountLoginName').setValue(Ext.util.JSON.decode(result.responseText));
-                this.registrationData.accountLoginName = Ext.util.JSON.decode(result.responseText);
-                //accountLoginName.setValue( Ext.util.JSON.decode(result.responseText));
-                // hack to detect user change
-                //accountLoginName.originalValue = accountLoginName.getValue();
-                //this.accountLoginName = accountLoginName.getValue();
-            },
-            
-            scope: this
-        });
-    },
-    
-    /**
-     * First card, all about names
-     * 
-     * @todo Ajax validation of accountLoginName is a bit complex, as library/ExtJS don't support syncrous requests.
-     * As such, we have to introduce a valid flag. If the user presses the next button, and the valid flag is not
-     * set, we have to ask the ajax-request if it's running, if yes, display a waitbar, if no ask the user to change the name.
-     * Therefore we also need to add a on-change listener to the filed.
-     * 
-     * @todo username change is not working yet
-     */
-    cardNames: function () {
-        
-        var accountFirstName = new Ext.form.TextField({
-            fieldLabel: _('Given name'),
-            name: 'accountFirstName',
-            id: 'accountFirstName',
-            allowBlank: true
-        });
-        accountFirstName.on('blur', function(textField){
-            this.registrationData.accountFirstName = textField.getValue();
-            this.getSuggestedUsername();
-        }, this);
-        
-        var accountLastName = new Ext.form.TextField({
-            fieldLabel: _('Family name'),
-            name: 'accountLastName',
-            id: 'accountLastName',
-            allowBlank: false
-        });
-        accountLastName.on('blur', function(textField){
-            this.registrationData.accountLastName = textField.getValue();
-            this.getSuggestedUsername();
-        }, this);
-        
-        var accountLoginName = new Ext.form.TextField({
-            fieldLabel: _('Login name'),
-            name: 'accountLoginName',
-            id: 'accountLoginName',
-            allowBlank: false
-        });
-        accountLoginName.on('blur', function(textField){
-            this.registrationData.accountLoginName = textField.getValue();
-        }, this);
-        accountLoginName.on('change', function(accountLoginName) {
-            //console.log('hallo');
-        }, this);
-
-        var accountEmailAddress = new Ext.form.TextField({
-            fieldLabel: _('Emailaddress'),
-            name: 'accountEmailAddress',
-            id: 'accountEmailAddress',
-            vtype: 'email',
-            allowBlank: false
-        });
-        accountEmailAddress.on('blur', function(textField){
-            this.registrationData.accountEmailAddress = textField.getValue();
-        }, this);
-        
-        var cardNamesPanel = new Ext.form.FormPanel({
-            id: 'cardNames',
-            layout: 'form',
-            bodyStyle: 'paddingLeft:15px',
-            anchor:'100%',
-            defaults: {
-                anchor: '95%',
-                xtype: 'textfield'
-            },
-            items: [
-                accountFirstName,
-                accountLastName,
-                accountEmailAddress,
-                accountLoginName
-            ]
-        });
-        
-        return cardNamesPanel;
-    },
-    /**
-     * @private 
-     */
-    getWizard: function() {
-        if (! this.wizard) {
-    
-            this.wizard = new Ext.ux.Wizard({
-                id: 'myWizard',
-                //title: 'My Example Wizard',
-                mandatorySteps: 2, // at least two steps are required
-    
-                // the panels (or "cards") within the layout
-                items: [
-                    this.cardNames(),
-                {
-                    id: 'card-1',
-                    style: {'padding': '5px'},
-                    html: '<h1>'+_('Congratulations!')+'</h1><p>'+_('You have entered all needed information. If you press the Finish button we will send you the registration email.')+'</p>'
-                }/*,{
-                    id: 'card-2',
-                    style: {'padding': '5px'},
-                    html: '<p>Step 3 of 5</p>'
-                },{
-                    id: 'card-3',
-                    style: {'padding': '5px'},
-                    html: '<p>Step 4 of 5</p>'
-                },{
-                    id: 'card-4',
-                    style: {'padding': '5px'},
-                    html: '<h1>Congratulations!</h1><p>Step 5 of 5 - Complete</p>'
-                }*/]
-            });
-                        
-            this.wizard.on({
-                'leave': {
-                    fn: function(currentItem, nextItem, forward) {
-                        switch(currentItem.id) {
-                            case 'cardNames':
-                                // check valid username
-                                //console.log('checking username .... ' + this.accountLoginName );
-                                //-- i'll set it to true for the moment (till the synchronous ajax function works)                                
-                                //var validUsername = false;
-                                var validUsername = true;
-                                
-/*                                if ( this.registrationData.accountLoginName ) {
-                                    Ext.Ajax.request({
-                                        url: 'index.php',
-                                        params: {
-                                            method: 'Tinebase_UserRegistration.checkUniqueUsername',
-                                            username: this.registrationData.accountLoginName
-                                        },
-
-                                        success: function(result, request) {
-                                            // get result
-                                            if ( Ext.util.JSON.decode(result.responseText) == true ) {
-                                                validUsername = true;
-                                            }
-                                        },
-
-                                        scope: this
-                                    });
-                                }
-
-                                if ( !this.registrationData.accountLoginName || validUsername !== true) {
-                                    Ext.Msg.show({
-                                        title:'Login name',
-                                        msg: 'The login name you chose is not valid. Please choose a valid login name.',
-                                        buttons: Ext.Msg.OK,
-                                        //fn: processResult,
-                                        animEl: 'elId',
-                                        icon: Ext.MessageBox.INFO
-                                    });
-                                    return false;
-                                }*/
-                        }
-                    },
-                    scope: this 
-                },
-                
-                'activate': {
-                    fn: function(currentItem) {
-                        //Ext.MessageBox.alert('Wizard', 'Entering ' + currentItem.id);
-                        
-                        if ( currentItem.id === 'card-1') {
-                            // check if all fields are filled in
-                            if (  !this.registrationData.accountFirstName || 
-                                  !this.registrationData.accountLastName ||
-                                  !this.registrationData.accountEmailAddress ||
-                                  !this.registrationData.accountLoginName ) {
-                                Ext.MessageBox.alert('Wizard', 'Please fill in all registration Fields.');
-                                this.wizard.setCurrentStep(this.wizard.getCurrentStep()-1);
-                            }
-                        }
-                        
-                    },
-                    scope: this
-                },
-                 
-                'cancel': {
-                    fn: function() {
-                        this.close();
-                        //Ext.MessageBox.alert('Wizard', 'Cancel');
-                    },
-                    scope: this
-                },
-                
-                'finish': {
-                    fn: function() {
-                        Ext.Ajax.request({
-                            url: 'index.php',
-                            params: {
-                                method: 'Tinebase_UserRegistration.registerUser',
-                                regData: this.registrationData
-                            },
-
-                            success: function(result, request) {
-                                this.close();
-                                // get result?
-                            },
-                            failure: function(result, request) {
-                                this.close();
-                                var response = Ext.util.JSON.decode(result.responseText);
-                                Ext.MessageBox.alert('Failed', response.msg );
-                            },
-                            scope: this
-                        });
-                    },
-                    scope: this
-                }    
-            }, this);
-        }
-        return this.wizard;
-    }
-});
diff --git a/tine20/Tinebase/views/activate.php b/tine20/Tinebase/views/activate.php
deleted file mode 100644 (file)
index e2d64bf..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-/**
- * user account activation view
- * 
- * @package     Tinebase
- * @subpackage  Views
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- * @todo        style it some more ... ;)
- */
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html>
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title><?php echo $this->escape($this->title) ?></title>
-</head>
-<body>
-    <h1>Welcome to Tine 2.0</h1>
-    <p>You are now able to login <a href="http://<?php echo $this->loginUrl ?>">here</a> with your activated account (username <?php echo $this->username ?>).</p>
-</body>
-</html>
diff --git a/tine20/Tinebase/views/lostpwMailHtml.php b/tine20/Tinebase/views/lostpwMailHtml.php
deleted file mode 100644 (file)
index c403f19..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<?php
-/**
- * lost password email text (html)
- * 
- * @package     Tinebase
- * @subpackage  Views
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- * @todo        fill with more text
- */
-?>
-
-<h1><?php echo $this->mailTextWelcome ?></h1>
-<p><?php echo $this->newPassword ?></p>
diff --git a/tine20/Tinebase/views/lostpwMailPlain.php b/tine20/Tinebase/views/lostpwMailPlain.php
deleted file mode 100644 (file)
index 118ea30..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-/**
- * lost password email text (plain)
- * 
- * @package     Tinebase
- * @subpackage  Views
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- * @todo        fill with more text
- */
-?>
-
-<?php echo $this->mailTextWelcome ?>
-
-<?php echo $this->newPassword ?>
diff --git a/tine20/Tinebase/views/registrationMailHtml.php b/tine20/Tinebase/views/registrationMailHtml.php
deleted file mode 100644 (file)
index cbb7fd8..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-/**
- * user registration email text (html)
- * 
- * @package     Tinebase
- * @subpackage  Views
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- */
-?>
-
-<h1><?php echo $this->mailTextWelcome ?></h1>
-<p>You have successfully registered to the new groupware system Tine 2.0. </p>
-<?php if (isset($this->mailActivationLink)) { ?>
-    <p>Please click on the activation link below to activate your account.</p>
-    <p><a href="<?php echo $this->mailActivationLink ?>"><?php echo $this->mailActivationLink ?></a></p>
-<?php } ?>
-<p>Your username and password are: <?php echo $this->username ?> / <?php echo $this->password ?></p>
-<p>Sincerly yours,<br/>
-   The Tine 2.0 Team</p>
-
diff --git a/tine20/Tinebase/views/registrationMailPlain.php b/tine20/Tinebase/views/registrationMailPlain.php
deleted file mode 100644 (file)
index 00d46d9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
-/**
- * user registration email text (plain)
- * 
- * @package     Tinebase
- * @subpackage  Views
- * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
- * @author      Philipp Schuele <p.schuele@metaways.de>
- * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
- *
- */
-?>
-
-<?php echo $this->mailTextWelcome ?>
-
-You have successfully registered to the new groupware system Tine 2.0. 
-
-<?php if (isset($this->mailActivationLink)) { ?>
-Please click on the activation link below to activate your account.
-<?php echo $this->mailActivationLink ?>
-<?php } ?>
-
-Your username and password are: <?php echo $this->username ?> / <?php echo $this->password ?>
-
-Sincerly yours,
-   The Tine 2.0 Team