This guide has been updated for elementaryOS v5.0+.
sudo apt-get update
sudo apt-get -y install software-properties-common
| <?php | |
| //Call this with the shown parameters (make sure $time and $end are integers and in Unix timestamp format!) | |
| //Get a link that will open a new event in Google Calendar with those details pre-filled | |
| function make_google_calendar_link($name, $begin, $end, $location, $details) { | |
| $params = array('&dates=', '/', '&location=', '&details=', '&sf=true&output=xml'); | |
| $url = 'https://www.google.com/calendar/render?action=TEMPLATE&text='; | |
| $arg_list = func_get_args(); | |
| for ($i = 0; $i < count($arg_list); $i++) { | |
| $current = $arg_list[$i]; |
| RewriteEngine On | |
| # This will enable the Rewrite capabilities | |
| RewriteCond %{HTTPS} !=on | |
| # This checks to make sure the connection is not already HTTPS | |
| RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] | |
| # This rule will redirect users from their original location, to the same location but using HTTPS. | |
| # i.e. http://www.example.com/foo/ to https://www.example.com/ foo/ | |
| # The leading slash is made optional so that this will work either in httpd.conf or .htaccess context |
| <?php | |
| //on pageload | |
| session_start(); | |
| $idletime=60;//after 60 seconds the user gets logged out | |
| if (time()-$_SESSION['timestamp']>$idletime){ | |
| session_destroy(); | |
| session_unset(); | |
| }else{ | |
| $_SESSION['timestamp']=time(); | |
| } |
| <?php | |
| /** | |
| * Send email | |
| * @param string|array $email | |
| * @param object $from | |
| * @param string $subject | |
| * @param string $message | |
| * @param string $headers optional | |
| */ | |
| function send_email($email, $from, $subject, $message, $headers = null) |
| # Delete all logs | |
| TRUNCATE ps_log; | |
| # Delete old connection data (only used for stats) | |
| # change 2016-02-01 00:00:00 according to you needs | |
| DELETE c, cs | |
| FROM ps_connections c | |
| LEFT JOIN ps_connections_source cs ON (c.id_connections = cs.id_connections) | |
| WHERE c.date_add < '2016-02-01 00:00:00'; |