/** * Checks the specified username and password against the stored admin credentials * @param string $username The username * @param string $password The MD5 encrypted password * @return bool TRUE if username and password match stored admin credentials */ function plx_gu_session_check_credentials($name, $username, $password, $user = FALSE) { if ($user == FALSE) { return $username == gu_config::get('admin_username') && $password == gu_config::get('admin_password'); } else { $users = gu_config::getUsers(); if (isset($users[$name])) { return $username == $users[$name]['login'] && $password == $users[$name]['password']; } else { return FALSE; } } }
<?php /************************************************************************ * @project Gutuma Newsletter Managment * @author Rowan Seymour * @copyright This source is distributed under the GPL * @file included menu page * @modifications Cyril Maguire */ /* Gutama plugin package * @version 1.6 * @date 01/10/2013 * @author Cyril MAGUIRE */ $u = gu_config::getUsers(); foreach ($u as $k => $v) { if ($v['id'] == $_SESSION['user']) { $u['connect'] = $k; } } if (gu_session_is_valid()) { ?> <div id="headerwelcome"><?php echo gu_config::get('collective_name'); ?> | <?php echo t('Welcome '); echo isset($u['connect']) ? $u['connect'] : gu_config::get('admin_name'); ?> | <a href="login.php?action=logout"><?php echo t('Logout');
*/ /* Gutama plugin package * @version 1.6 * @date 01/10/2013 * @author Cyril MAGUIRE */ include_once 'inc/gutuma.php'; if (isset($_GET['token'])) { list($name, $username, $password, $salt, $userProfile, $id, $new_record) = explode('[::]', unserialize(base64_decode($_GET['token']))); list($user_name, $user_login, $user_password, $user_salt, $user_userProfile, $user_id) = explode('[::]', unserialize(base64_decode($new_record))); $user_salt = substr($user_salt, 1, -2); } else { header('Location:./index.php'); } gu_init(); $users = gu_config::getUsers(); if (isset($users[$user_name])) { header('location:' . str_replace('plugins/gutuma/news', 'core/admin', absolute_url('plugin.php?p=gutuma&rec=done&u=' . $users[$user_name]['id']))); } // Save settings if (is_post_var('save_settings')) { if (isset($users[$user_name])) { gu_error(t('<span style="color:red;">User already exists !</span>')); } else { gu_config::setUsers(get_post_var('id'), get_post_var('name'), get_post_var('login'), get_post_var('password'), base64_decode(get_post_var('salt')), get_post_var('userProfile')); if (gu_config::save()) { $ok = ''; } gu_success(t('New user successfully saved.')); } }