This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

combine commentics with existing login system on own website
#1
Rainbow 

First let me say that your script is awesome. Thanks for your hard work and thank you for sharing this with the rest of us!

I would like to combine commentics with an existing login system, as an alternative to any other security measures already in place by commentics like captcha etc. I understand that I can [font=Tahoma,Verdana,Arial,sans-serif]supply confimed login details to Commentics and prefill form fields by adding something like this to the top of my integration code:[/font]

Code:
if($session->logged_in){
   $cmtx_set_name_value = 'user_name';
   $cmtx_set_email_value = 'bla';
   ...
   cmtx_setting('state_name') == 'hide';  --> where can I find "cmtx_settings()" ??!
   ...
}
[font=Tahoma,Verdana,Arial,sans-serif]I believe that starting from the following line (in "../apps/processor.php") the above code gets processed:

[/font]

Code:
if (isset($cmtx_set_name_value) && !empty($cmtx_set_name_value) && cmtx_setting('state_name') != 'normal')
...
But where can I find cmtx_setting()? I don't want to change state_name, state_email and so on in the admin menu. I'd like to leave it to the user if he wants to login or use the captcha test etc.

Also, I modified "/includes/app/processesor.php" and renamed it. I get an 403 (Forbidden) when I try to access the new file. But when I put the renamed file in "/commentics/includes/" it works. Are there any folder restrictions or anything like this?

Thank you for your time!
Reply
#2

Hi Joerg,

Sorry for the late reply. When it does cmtx_setting('state_name') it is retrieving the state_name setting from the 'settings' database table. It gets run through the cmtx_setting() function in /includes/functions/page.php. The value of cmtx_setting('state_name') will be the same as the value that you see in 'Layout -> Form -> States'.

Normally you wouldn't directly access anything in the /includes/ folder from your web browser. Those files are meant to be included by the system and not for viewing. As such, there's a .htaccess file in the /includes/ folder to restrict direct access. This propagates down to all sub-folders, including /app/. Also, just in case the .htaccess doesn't work, inside those folders are index.html files which give the impression that it's a 403 even though it's not.

Have you completed the interview?
Reply
#3

Hi Steven,

Thank's for getting back to me. I can imagine that answering all those questions from all those people must be quite a task. On top of that, I am sure you need to take care of other things as well. Your answer is much appreciated. 

I finally found "function cmtx_setting($title) { //gets a setting..". I missed it all the times I looked through "../page.php". I'll try and see how far I get. 
If I get stuck and need to ask again I hope you can spare some of your time again.

Thank you.
Reply
#4

Hi all, new to Commentics
Anyway it looks what I need.
Before I dig too deep, can anyone confirm that, if my user is logged in properly on my website I can use the same credentials for Commentics or make Commentics know user is properly logged in and is a specific one?
Apologies for the quesiton but login integration is the key requirement of my users and I'd like to be 100% sure upfront.
PS: Even better would be to be able pass the login credentials ALSO from Commentics to actual login system but this is not strictly needed.
Thanks
Reply
#5

Yes, you can provide your website's login credentials to Commentics.

For example you might have:

PHP Code:
<?php
$cmtx_name 
$website_login_name;
$cmtx_email $website_login_email;

$cmtx_identifier '1';
$cmtx_reference  'Page One';
$cmtx_folder     '/upload/';
require(
$_SERVER['DOCUMENT_ROOT'] . $cmtx_folder 'frontend/index.php');
?>

In the admin area you can then go to 'Settings -> Layout -> Form', edit the 'Name' field and change the 'Filled (Login)' setting depending on how you want the field to behave when login info is supplied to it.

More info:
https://www.commentics.org/wiki/doku.php...in_details

Have you completed the interview?
Reply
#6

Thank you!
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by kbadmin
28-May-2019, 07:16 PM
Last Post by Carluti
09-Jan-2016, 04:26 PM
Last Post by bobby
10-Oct-2015, 10:11 PM
Last Post by finzer
30-Apr-2015, 09:12 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)