HEX
Server: Apache/2.4.41 (Amazon) OpenSSL/1.0.2k-fips PHP/5.6.40
System: Linux ip-172-31-40-18 4.14.146-93.123.amzn1.x86_64 #1 SMP Tue Sep 24 00:45:23 UTC 2019 x86_64
User: apache (48)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //var/www/html/pmw24/driver_settlement/application/helpers/common_helper_02_04_2019.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('test_method'))
{
    function registration_mail($params){
       $params['config']=email_settings();
       sendmail($params);
       return 1;
    } 
    function forgotpassword_mail($params){
       $params['config']=email_settings();
       sendmail($params);
       return 1; 
    } 
    function email_settings(){
      	$config['protocol']    = 'smtp';
        $config['smtp_host']    = 'mail.met-technologies.com';
        $config['smtp_port']    = '25';        
        $config['smtp_user']    = 'developer.net@met-technologies.com';
        $config['smtp_pass']    = 'Dot123@#$%';
        $config['charset']    = 'utf-8';
        $config['newline']    = "\r\n";
        $config['mailtype'] = 'html'; // or html
        $config['validation'] = TRUE; // bool whether to validate email or not     
        return $config; 
    } 
    function sendmail($params){
    	  $obj =get_object();
    	  $obj->load->library('email');
        $obj->email->initialize($params['config']);
        $obj->email->from('developer.net@met-technologies.com',$params['name']); 
        $obj->email->to($params['to']); 
        $obj->email->subject($params['subject']);
        $obj->email->message($params['message']);  
        $obj->email->set_crlf( "\r\n" );
        return $obj->email->send();
    }
    function get_user_role_type(){
      $user_role=get_object()->session->userdata('user_role');
      return $user_role;
    } 
    function get_object(){
      $obj =& get_instance();
      return $obj;
    }
     function getRandomString($length = 6) {
      $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
      $string = '';

      for ($i = 0; $i < $length; $i++) {
          $string .= $characters[mt_rand(0, strlen($characters) - 1)];
      }

      return $string;
    }
}