예제 #1
0
    $smarty->assign('dbcon', 'y');
    $smarty->assign('dbname', isset($dbs_tiki) ? $dbs_tiki : null);
} else {
    $smarty->assign('dbcon', 'n');
}
// Some initializations to avoid PHP error messages
$smarty->assign('tikidb_created', FALSE);
$smarty->assign('tikidb_is20', FALSE);
if ($dbcon) {
    $has_tiki_db = has_tiki_db();
    $smarty->assign('tikidb_created', $has_tiki_db);
    $oldPerms = $installer->getOne('SELECT COUNT(*) FROM `users_permissions` WHERE `permDesc` = \'Can view categorized items\'');
    $smarty->assign('tikidb_oldPerms', $oldPerms);
    if ($install_step == '6' && $has_tiki_db) {
        update_preferences($prefs);
        $smarty->assign('admin_email', get_admin_email());
        $smarty->assign('upgradefix', empty($dbversion_tiki) || $dbversion_tiki[0] < 4 ? 'y' : 'n');
    }
    $smarty->assign('tikidb_is20', has_tiki_db_20());
}
if (isset($_REQUEST['restart'])) {
    $_SESSION["install-logged-{$multi}"] = '';
}
$smarty->assign('admin_acc', $admin_acc);
// If no admin account then we are logged
if ($admin_acc == 'n') {
    $_SESSION["install-logged-{$multi}"] = 'y';
}
$smarty->assign('dbdone', 'n');
$smarty->assign('logged', $logged);
// Installation steps
예제 #2
0
    $smarty->assign('dbcon', 'y');
    $smarty->assign('dbname', $dbs_tiki);
} else {
    $smarty->assign('dbcon', 'n');
}
// Some initializations to avoid PHP error messages
$smarty->assign('tikidb_created', FALSE);
$smarty->assign('tikidb_is20', FALSE);
if ($dbcon) {
    $has_tiki_db = has_tiki_db();
    $smarty->assign('tikidb_created', $has_tiki_db);
    $oldPerms = $installer->getOne('SELECT COUNT(*) FROM `users_permissions` WHERE `permDesc` = \'Can view categorized items\'');
    $smarty->assign('tikidb_oldPerms', $oldPerms);
    if ($install_step == '6' && $has_tiki_db) {
        update_preferences($dbTiki, $prefs);
        $smarty->assign('admin_email', get_admin_email($dbTiki));
        $smarty->assign('upgradefix', empty($dbversion_tiki) || $dbversion_tiki[0] < 4 ? 'y' : 'n');
    }
    $smarty->assign('tikidb_is20', has_tiki_db_20());
}
if (isset($_REQUEST['restart'])) {
    $_SESSION["install-logged-{$multi}"] = '';
}
$smarty->assign('admin_acc', $admin_acc);
// If no admin account then we are logged
if ($admin_acc == 'n') {
    $_SESSION["install-logged-{$multi}"] = 'y';
}
$smarty->assign('dbdone', 'n');
$smarty->assign('logged', $logged);
// Installation steps
예제 #3
0
 function register_checkout_success()
 {
     $user_id = $_GET['id'];
     $user = $this->user_model->get_user_from_id($user_id);
     $this->user_model->upgrade_member($user_id);
     $data['name'] = $user->name;
     $data['email'] = $user->email;
     $data['password'] = $this->session->userdata('password');
     //$this->session->unset_userdata('password');
     $emailto = array($user->email, get_admin_email(), '*****@*****.**');
     $data['member'] = "Guldmedlemskab";
     $data['price'] = get_config_value('gold_member_fee');
     $data['login'] = base_url() . index_page() . 'user/login.html';
     $data['site'] = base_url() . index_page() . 'index.html';
     if (getUser()) {
         redirect(base_url() . index_page() . 'user/owner.html');
     } else {
         $this->general_model->sendEmail($emailto, "Sugardating.dk byder dig velkommen som medlem", 'signup', array('data' => $data), '');
         redirect(base_url() . index_page() . 'user/register_success.html');
     }
 }
예제 #4
0
function resend_admin_password($admin)
{
    $admin = sanitize($admin);
    $password = randomPassword();
    $email = get_admin_email($admin);
    $id = get_admin_id($admin);
    $admin = get_admin_by_id($id);
    $to = $email;
    $toName = $admin[0] . " " . $admin[1];
    $subject = get_text('Title') . ': ' . get_text('New_password');
    $message = get_text('Dear') . ' ' . $admin[0] . ",\n\t\t<p>\n\t\t\t" . get_text('New_user_credentials') . ":\n\t\t\t<br />\n\t\t\t" . get_text('Username') . ": " . $admin[0] . "\n\t\t\t<br />\n\t\t\t" . get_text('Password') . ": " . $password . "\n\t\t</p>" . get_text('Mail_footer');
    mailFromProject($to, $toName, $subject, $message);
    $hashed_password = password_hash($password, PASSWORD_DEFAULT);
    mysql_query("UPDATE admin SET Password = '******' WHERE ID = {$id}");
    return get_text('New_password_send');
}
예제 #5
0
 /**
  * Send email for password resetting.
  *
  * @param Request $request
  * @return Redirect
  */
 public function sendPasswordEmail(Request $request)
 {
     $fields = array('username' => Input::get('username'));
     // doing the validation, passing post data, rules and the messages
     $validator = Validator::make($fields, User::$forgot_password_rules);
     if ($validator->fails()) {
         // send back to the page with the input data and errors
         return Redirect::to('users/forgotPassword')->withInput()->withErrors($validator);
     } else {
         $username = $request->input('username');
         $user = User::where('email', '=', $username)->first();
         //find user by given username
         if ($user) {
             $data['uid'] = $user->id;
             $data['email'] = $user->email;
             $encrypt = md5(1490 * 4 + $data['uid']);
             $data['password_reset_link'] = url() . '/users/resetPassword/' . $encrypt;
             $data['admin_email'] = get_admin_email();
             // get admin email
             dd($data);
             Mail::send('emails.reset_password', $data, function ($message, $data) {
                 $message->from($data['admin_email'], 'Admin');
                 $message->to($data['email']);
                 $message->subject('Reset Your Password');
             });
             Session::flash('success', 'Please check your mails..for further details');
         } else {
             Session::flash('error', 'Invalid email address.please type a valid email');
         }
         return redirect('users/forgotPassword');
     }
 }