Posts: 218
Threads: 59
Joined: May 2013
Hello all,
i would like to make a plugin for get-simple based on an external script with running on flat file datebase.
Following open questons:
1. Which kind of modifications i have to do to change the script?
2. what i have to do to use the existing "login system" of the get-simple admin to use my external script which has own "admin,php" file for login?
3. what i must do to setup multi-language into the script?
Hope anyone can help me in this case.
Thanks.
best regards,
Harald
P.S. it is a calender with booking system nicht to use good go get-simple but currently only external.
Posts: 6,267
Threads: 182
Joined: Sep 2011
Well you will have to look at our code and figure it out, there is no api ( well there is one for getting page data, but it is not very advanced )
You can start by looking at login_functions and how it validates users. Our authentication system is pretty crappy, its just a cookie check on some salted values, and a global for $USR based on another user name cookie.
main files of interest are
inc/common.php
from there you can see the includes for login_functions, basic.php, cookie_functions.php
If you just want to use this script in gs then make it a plugin and use our user functions and remove the auth from the plugin script. But without more details about a particular project there is not much else to tell you.
Posts: 149
Threads: 8
Joined: Dec 2011
(2013-12-13, 00:26:49)shawn_a Wrote: Our authentication system is pretty crappy, its just a cookie check on some salted values, and a global for $USR based on another user name cookie.
Maybe it's me but I'd not be so open about this. Especially also saying that it's pretty crappy. Could be considered by some less-than-honest programming-savvy types as an invite to try and wreak some havoc.
Having said that, you're doing great work on the project as it is, so don't take it the wrong way. But at the same time, if the authentication system isn't all that good now it would seem like a good idea to replace it with a much better one in the near future (but for all I know that's in the works already).
Posts: 6,267
Threads: 182
Joined: Sep 2011
hah, crappy in implementation, has nothing to do with security.
There is no need for anything else , its a flat file cms, we support php 4.23 and do not use sessions, crappy.
Its just a matter of fact.
crappy, means lacking in luster. Not sure what it means to you.
Its also just some crappy cookie check functions, so its crappy to use.
Posts: 3,491
Threads: 106
Joined: Mar 2010
I thought it was PHP 5.2+ ...
Posts: 149
Threads: 8
Joined: Dec 2011
2013-12-14, 00:59:35
(This post was last modified: 2013-12-14, 01:00:33 by Draxeiro.)
(2013-12-14, 00:29:56)shawn_a Wrote: hah, crappy in implementation, has nothing to do with security.
There is no need for anything else , its a flat file cms, we support php 4.23 and do not use sessions, crappy.
Its just a matter of fact.
crappy, means lacking in luster. Not sure what it means to you.
Its also just some crappy cookie check functions, so its crappy to use.
Let's cut the crap then
Seriously, crappy could've meant any number of things (could also mean badly programmed, for instance) so thanks for the elaboration Shawn.
Still it does sound as you would have done it differently. Any plans on making it less...crappy?
Posts: 6,267
Threads: 182
Joined: Sep 2011
I would like it to be a class, right now its confusing to track down stuff and make sure everything is secure, it needs to be centralized and easier to use programmatic wise.
Plus there are globals in use, and that leaves you open for new exploits in the future.
Posts: 218
Threads: 59
Joined: May 2013
i now confused first time the installation part of the plugin works and now allways if i like to install it i get error message "an error....." i don´t know what are the error
Did the system log my error ? Or who i can shown the error which i have done?
Posts: 6,267
Threads: 182
Joined: Sep 2011
data/other/logs/error.log
and turn debug mode on in gsconfig
Posts: 218
Threads: 59
Joined: May 2013
Hi,
i have the following error inside my logfile:
PHP Parse error: syntax error, unexpected '}' in /var/www/web0/html/dev/plugins/bookingcalendar.php on line 53
Here the code of line 53: see the arrow -->
$xml = simplexml_load_file($file);
$lang = $xml->lang;
i18n_merge('bookingcalendar', $lang) || i18n_merge('bookingcalendar', 'en_US');
$LANG = $lang;
unset($xml, $file, $lang);
# hooks, filters
add_action('pages-sidebar', 'createSideMenu', array($thisfile, i18n_r('bookingcalendar/bookingcalendar')));
# file check
if(!is_dir(GSDATAOTHERPATH.'/bookingcalendar')) {
mkdir(GSDATAOTHERPATH.'/bookingcalendar');
}
#$_GET check
#if(!isset($_GET['bookingcalendar']) and !isset($_GET['settings']) and !isset($_GET['edit'])) $_GET['events'] = True;
# admin
include 'bookingcalendar/inc/bookingcalendar.php';
function c_admin() {
include 'bookingcalendar/admin.php';
---> }
what´s wrong ?
Posts: 6,267
Threads: 182
Joined: Sep 2011
Posts: 218
Threads: 59
Joined: May 2013
Hi,
yes if i remove this } i can register the plugin.
But currently i don´t understand what i have to do to register my "login" into the plugin,
Currently the standalone script use a "user and password" login which are diffent to the get simple system.
Anyone can help me what i have to do to convert this ?
Hope you can help.
Harald
|