<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * Upgrade user module to version 1.3.0
 *
 * @author CIEXT skeleton
 */
class user_upgrade_0 extends Abstract_upgrade
{

    public function up()
    {
        $ci = & get_instance();
        $ci->load->library('emailmng/emailmng_installer')->install_emailmng();

        // Confirm template
        $ci->emailmng_installer
                ->set_subject($ci->lang->line('Confirm account'))
                ->set_message($ci->lang->line('To confirm your registration click on the [[url]]'
                                . ', after which your account will be activated.')
                        , $ci->lang->line('The following string will be replace: [[url]] - confirm link'))
                ->add_template('confirm');

        // Recovery template
        $ci->emailmng_installer
                ->set_subject($ci->lang->line('Passwordless login'))
                ->set_message($ci->lang->line('To change your current password to [[pass]] click on the following link. [[url]] ')
                        , $ci->lang->line('The following string will be replace:[[pass]] - new password, [[url]] - confirm link'))
                ->add_template('recovery_msg');

        return '1.3.0';
    }

    public function down()
    {
        return '0';
    }

}
