Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
external script as a plugin / module
#1
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.
Reply
#2
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
(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).
Reply
#4
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.

Smile
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#5
I thought it was PHP 5.2+ ...
Reply
#6
(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.

Smile

Let's cut the crap then Big Grin

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? Cool
Reply
#7
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.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
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 Sad

Did the system log my error ? Or who i can shown the error which i have done?
Reply
#9
data/other/logs/error.log
and turn debug mode on in gsconfig
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#10
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 ?
Reply
#11
remove the }
?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
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
Reply




Users browsing this thread: 1 Guest(s)