koretek Posted February 3, 2007 Share Posted February 3, 2007 :-" hello, i'm a bit of a newbie here, and i'm not entirely sure how to instal this contribution (Login to View Site) i don't know how to "run the following SQL" :blink: :( ################################################################################ 1) Run the following SQL insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Login for Site Access', 'REQUIRE_LOGIN_FOR_SITE_ACCESS', 'False', 'Do you want to force users to login before being able to access site?', '1', '33', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now()) NOTE ****** change SQL statement below 'http://www.yoursite.com/mysite.html' to what you want (also add more sites if you want to here) NOTE ****** insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Login Redirect', 'REQUIRE_LOGIN_FOR_SITE_ACCESS_URL', 'Current Site', 'Please select the URL you wish to redirect to.', '1', '34', 'tep_cfg_select_option(array(\'Current Site\', \'http://www.yoursite.com/mysite.html\'), ', now()) 2) Simply paste these lines on the BOTTOM of your application_top.php file, right before the last ?> //require login begin if (REQUIRE_LOGIN_FOR_SITE_ACCESS == 'True') { if ( (!tep_session_is_registered('customer_id')) && (!strstr($_SERVER['PHP_SELF'],'login.php')) ) { if ( (!strstr($_SERVER['PHP_SELF'],'create_account.php')) && (!strstr($_SERVER['PHP_SELF'],'password_forgotten.php')) && (!strstr($_SERVER['PHP_SELF'],'create_account_success.php')) && (!strstr($_SERVER['PHP_SELF'],'contact_us.php'))) { $navigation->set_snapshot(); if (REQUIRE_LOGIN_FOR_SITE_ACCESS_URL == 'Current Site') { tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); } else { tep_redirect(REQUIRE_LOGIN_FOR_SITE_ACCESS_URL); } } } } //require login end ################################################################################ my hosting company has phpMyAdmin for me to be able to edit the sql (i guess), which i'm not too sure how to use if someone could please point me in the right direction and help me figure out how to instal this it would be greatly appreciated thanks so much in advance cheers :) Link to comment Share on other sites More sharing options...
spax Posted February 3, 2007 Share Posted February 3, 2007 Access phpmyadmin - select your database - click on SQL tab, top of the screen - paste the sql code into the text area (remembering to change the URL as instructed) - click on the Go button - job done! Link to comment Share on other sites More sharing options...
koretek Posted February 4, 2007 Author Share Posted February 4, 2007 Access phpmyadmin - select your database - click on SQL tab, top of the screen - paste the sql code into the text area (remembering to change the URL as instructed) - click on the Go button - job done! thank you sooooo!! i feel like such a newb :P (which i am) so i did what it said then when i did step 2 (applied it to both the includes/application_top.php and admin/includes/application_top.php under MyStore cinfiguration i go to change the Require Login for Site Access to True and i get this: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/permaloc/public_html/taos/admin/configuration.php(125) : eval()'d code on line 1 any idea on what it is and how to fix it? sorry for all the trouble :( thanks inadvance to anyone who can help cheers :) Link to comment Share on other sites More sharing options...
koretek Posted February 4, 2007 Author Share Posted February 4, 2007 thank you sooooo!! i feel like such a newb :P (which i am) so i did what it said then when i did step 2 (applied it to both the includes/application_top.php and admin/includes/application_top.php under MyStore cinfiguration i go to change the Require Login for Site Access to True and i get this: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/permaloc/public_html/taos/admin/configuration.php(125) : eval()'d code on line 1 any idea on what it is and how to fix it? sorry for all the trouble :( thanks inadvance to anyone who can help cheers :) CORRECTION: i think this error occurs before i do step 2 because when i took away the code added to application_top.php the problem is still there :S any ideas would be great :blush: thnx Link to comment Share on other sites More sharing options...
spax Posted February 4, 2007 Share Posted February 4, 2007 I loaded the mod to take a look and it worked fine. The only thing I can guess at, is you may have entered too many URLs for the re-direct option. I don't understand why that would cause the error when setting the Require Login option to True but being as the value for the options is limited to varchar(255), if you put too many characters into the string, it would throw up this error. BTW, That code addition only needs to go into includes/application_top.php Link to comment Share on other sites More sharing options...
koretek Posted February 4, 2007 Author Share Posted February 4, 2007 I loaded the mod to take a look and it worked fine. The only thing I can guess at, is you may have entered too many URLs for the re-direct option. I don't understand why that would cause the error when setting the Require Login option to True but being as the value for the options is limited to varchar(255), if you put too many characters into the string, it would throw up this error. BTW, That code addition only needs to go into includes/application_top.php ok so i decided to delete it and reinstal it again and it works fine.. what i think happened is the first time i installed it, the server must have comped out because it appeared to have been installed twice... now that there's only one installed version, it works great! thanks spax so much, you've been a great help! cheers :) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.