fixed logo
This commit is contained in:
28
actions/administrator/flush.php
Normal file
28
actions/administrator/flush.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Open Source Social Network
|
||||
*
|
||||
* @package (softlab24.com).ossn
|
||||
* @author OSSN Core Team <info@softlab24.com>
|
||||
* @copyright (C) SOFTLAB24 LIMITED
|
||||
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
|
||||
* @link https://www.opensource-socialnetwork.org/
|
||||
*/
|
||||
|
||||
$disable = input('disabled');
|
||||
if(ossn_site_settings('cache') == true || !empty($disable)){
|
||||
if(ossn_disable_cache() && empty($disable)){
|
||||
//flush cache didn't flush the plugins path #460
|
||||
$action = ossn_add_tokens_to_url("action/admin/cache/flush?disabled=disabled");
|
||||
redirect($action);
|
||||
} elseif($disable == 'disabled'){
|
||||
if(ossn_create_cache()){
|
||||
ossn_trigger_message(ossn_print('cache:flushed'));
|
||||
redirect(REF);
|
||||
}
|
||||
}
|
||||
}
|
||||
ossn_trigger_message(ossn_print('cache:flush:error'), 'error');
|
||||
redirect(REF);
|
||||
|
||||
|
||||
78
actions/settings.php
Normal file
78
actions/settings.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Open Source Social Network
|
||||
*
|
||||
* @package (softlab24.com).ossn
|
||||
* @author OSSN Core Team <info@softlab24.com>
|
||||
* @copyright (C) SOFTLAB24 LIMITED
|
||||
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
|
||||
* @link https://www.opensource-socialnetwork.org/
|
||||
*/
|
||||
|
||||
$site = new OssnFile;
|
||||
$site->setFile('logo_site');
|
||||
$site->setExtension(array(
|
||||
'png',
|
||||
));
|
||||
if(isset($site->file['tmp_name']) && $site->typeAllowed()){
|
||||
$file = $site->file['tmp_name'];
|
||||
$size = filesize($file);
|
||||
if($size > 0){
|
||||
if($size > 500000){ //500KB
|
||||
ossn_trigger_message(ossn_print('theme:atlas:logo:large'), 'error');
|
||||
redirect(REF);
|
||||
}
|
||||
$contents = file_get_contents($file);
|
||||
if(strlen($contents) > 0 && file_put_contents(ossn_route()->themes.'atlas/images/logo.png', $contents)){
|
||||
$cache = ossn_site_settings('cache');
|
||||
if($cache == false) {
|
||||
$done = true;
|
||||
} else {
|
||||
$done = 2;
|
||||
}
|
||||
} else {
|
||||
$done = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
$admin = new OssnFile;
|
||||
$admin->setFile('logo_admin');
|
||||
$admin->setExtension(array(
|
||||
'jpg',
|
||||
'jpeg',
|
||||
));
|
||||
if(isset($admin->file['tmp_name']) && $admin->typeAllowed()){
|
||||
$file = $admin->file['tmp_name'];
|
||||
$size = filesize($file);
|
||||
if($size > 0){
|
||||
if($size > 500000){ //500KB
|
||||
ossn_trigger_message(ossn_print('theme:atlas:logo:large'), 'error');
|
||||
redirect(REF);
|
||||
}
|
||||
$contents = file_get_contents($file);
|
||||
if(strlen($contents) > 0 && file_put_contents(ossn_route()->themes.'atlas/images/logo_admin.jpg', $contents)){
|
||||
$cache = ossn_site_settings('cache');
|
||||
if($cache == false) {
|
||||
$done = true;
|
||||
} else {
|
||||
$done = 2;
|
||||
}
|
||||
} else {
|
||||
$done = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if($done === true){
|
||||
ossn_trigger_message(ossn_print('theme:atlas:logo:changed'));
|
||||
redirect(REF);
|
||||
} elseif($done == 2){
|
||||
//redirect and flush cache
|
||||
ossn_trigger_message(ossn_print('theme:atlas:logo:changed'));
|
||||
$action = ossn_add_tokens_to_url("action/admin/cache/flush");
|
||||
redirect($action);
|
||||
} else {
|
||||
ossn_trigger_message(ossn_print('theme:atlas:logo:failed'), 'error');
|
||||
redirect(REF);
|
||||
}
|
||||
49
actions/user/login.php
Normal file
49
actions/user/login.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
/**
|
||||
* Open Source Social Network
|
||||
*
|
||||
* @package (softlab24.com).ossn
|
||||
* @author OSSN Core Team <info@softlab24.com>
|
||||
* @copyright (C) SOFTLAB24 LIMITED
|
||||
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
|
||||
* @link https://www.opensource-socialnetwork.org/
|
||||
*/
|
||||
|
||||
if(ossn_isLoggedin()) {
|
||||
redirect('home');
|
||||
}
|
||||
$username = input('username');
|
||||
$password = input('password');
|
||||
|
||||
if(empty($username) || empty($password)) {
|
||||
ossn_trigger_message(ossn_print('login:error') , 'error');
|
||||
redirect();
|
||||
}
|
||||
$user = ossn_user_by_username($username);
|
||||
|
||||
//check if username is email
|
||||
if(strpos($username, '@') !== false) {
|
||||
$user = ossn_user_by_email($username);
|
||||
$username = $user->username;
|
||||
}
|
||||
|
||||
if($user && !$user->isUserVALIDATED()) {
|
||||
$user->resendValidationEmail();
|
||||
ossn_trigger_message(ossn_print('ossn:user:validation:resend'), 'error');
|
||||
redirect(REF);
|
||||
}
|
||||
$vars = array(
|
||||
'user' => $user
|
||||
);
|
||||
ossn_trigger_callback('user', 'before:login', $vars);
|
||||
|
||||
$login = new OssnUser;
|
||||
$login->username = $username;
|
||||
$login->password = $password;
|
||||
if($login->Login()) {
|
||||
//One uneeded redirection when login #516
|
||||
ossn_trigger_callback('login', 'success', $vars);
|
||||
redirect('home');
|
||||
} else {
|
||||
redirect('login?error=1');
|
||||
}
|
||||
12
actions/user/logout.php
Normal file
12
actions/user/logout.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Open Source Social Network
|
||||
*
|
||||
* @package (softlab24.com).ossn
|
||||
* @author OSSN Core Team <info@softlab24.com>
|
||||
* @copyright (C) SOFTLAB24 LIMITED
|
||||
* @license Open Source Social Network License (OSSN LICENSE) http://www.opensource-socialnetwork.org/licence
|
||||
* @link https://www.opensource-socialnetwork.org/
|
||||
*/
|
||||
OssnUser::Logout();
|
||||
redirect();
|
||||
Reference in New Issue
Block a user