My browse_by_cat.html under templates is as follows:
{use_macro file="Dataface_Main_Template.html"}
{fill_slot name="main_section"}
Browse by City
{foreach from=$categories item=category key=ctr}
{if $ctr%$per_column == 0}
{if $ctr>0}
Error message
12 posts
• Page 1 of 1
I have setup the librarian site and created an inspection site on one of my test servers. You can view at-> http://nvang.com/librarian and http://nvang.com/inspection. I am attempting to achieve the same result as "Browse by Category" for my "Browse by City". {/if}My browse_by_cat.html under templates is as follows: {use_macro file="Dataface_Main_Template.html"} {fill_slot name="main_section"} Browse by City{foreach from=$categories item=category key=ctr} {if $ctr%$per_column == 0} {if $ctr>0}
{/if} {/foreach} {/fill_slot} {/use_macro} My browse_by_cat.php under actions is as follows: :]]'"; //echo $sql2; $res2 = mysql_query($sql2, df_db()); list($num) = mysql_fetch_row($res2); if ( $num ){ $categories[] = array('name'=>$row['city_name'], 'id'=>$row['city_id'], 'num'=>$num); } @mysql_free_result($res2); } @mysql_free_result($res); $num_cats = count($categories); $per_column = ceil($num_cats/4); df_display(array('categories'=>$categories, 'per_column'=>$per_column), 'browse_by_cat.html'); } } ?> My database has a table called "city" with two fields "city_id" and "city_name". Any thoughts why I am getting the error message? Also, when I login I do not have the ability to edit or update records. Any assistance in pointing me in the right direction would be appreciated. TIA, Steve
I am no longer getting the error message but still have two questions. Here is what I did. I modified browse_by_cat.php - I have a city table with city_id and city_name and a permit table with various fields including establishment and permit_id. The thought is to draw a business name (restaurant or establishment) which has an inspection permit and allow a user to search either by city or restaurant so they can see the results of the inspection. Do I need a city reference to my city table inorder to make this work or is there another process?
:]]'"; //echo $sql2; $res2 = mysql_query($sql2, df_db()); list($num) = mysql_fetch_row($res2); if ( $num ){ $categories[] = array('name'=>$row['establishment'], 'id'=>$row['permit_id'], 'num'=>$num); } @mysql_free_result($res2); } @mysql_free_result($res); $num_cats = count($categories); $per_column = ceil($num_cats/4); df_display(array('permit'=>$categories, 'per_column'=>$per_column), 'browse_by_cat.html'); } } ?> My last question is as in the first post. How do I enable editing on the the librarian db 0.1.3 as I am using this as my format for my inspection application. I can login and create another admin user in phpmyadmin but it simply does not allow me to make changes on the frontend once I login. It never indicates I am logged in but does accept the UID/PW. TIA, Steve
Late on this end ... Here is the correct body of context from browse_by_cat.php ->
$sql = "select * from permits order by establishment"; $res = mysql_query($sql, df_db()); $categories = array(); while ( $row = mysql_fetch_assoc($res) ){ //print_r($row); $sql2 = "select count(*) as num from permits where categories rlike '[[:<:]]".$row['permit_id']."[[:>:]]'"; //echo $sql2; $res2 = mysql_query($sql2, df_db()); list($num) = mysql_fetch_row($res2); if ( $num ){ $categories[] = array('name'=>$row['establishment'], 'id'=>$row['permit_id'], 'num'=>$num); } @mysql_free_result($res2); } @mysql_free_result($res); $num_cats = count($categories); $per_column = ceil($num_cats/4); df_display(array('permit'=>$categories, 'per_column'=>$per_column), 'browse_by_cat.html'); TIA, Steve
Sorry.. the current version has a bit of a glitch in that it doesn't give you an error when you give an incorrect username/password for login. Passwords should be stored using MD5 encryption. If you are storing them as plain text that won't work. You can set this when you create a new record in PHPMyAdmin. There is a pulldown list beside each field that allows you to perform processing on the input. Choose MD5. As for the questions about the browse_by_cat.php it is difficult for me to comment on this without knowing what the db structure is and exactly what you are trying to do. If you want to be able to browse by city, however, you'll need to have a way to know which permit is in which city. Perhaps a city_id column would do, or just a city_name, if you wanted it to be a little more free for input. Then you could obtain your categories quite easily using something like: "select c.city_name, c.city_id, count(*) as num from cities c inner join permits p on c.city_id=p.city_id group by city_id,city_name order by city_name" for example. -Steve
I think most of this I have solved thanks to the excellent responses in the forums. Perhaps I am missing a very simple step but this has me perplexed.
I have a working application called "inspections". This is installed on one server. I then tgz the inspection directory and perform a inspection.sql dump of all tables using phpmyadmin. I load the tgz inspection directory to another server and setup a database with the same name using the inspection.sql dump. All works fine except one thing: When I login using the same credentials on both servers (and I am using md5) the login in the right under search does not change as it does on the initial server. I have chmod the settings to 777 for dataface as well as set apache.apache just for testing. This is the only thing not working as the initial server on the subsequent server although everything else is the same. Any thoughts what might be causing this as I am stumped? TIA, Steve
I am trying to follow your Creating a submission Form tutorial. I did my own and then installed you tar files to my server and have the same results. Application is http://nvang.com/inspection/
Here is my user table -> CREATE TABLE `users` ( `userid` int(11) NOT NULL auto_increment, `username` varchar(32) NOT NULL default '', `password` varchar(32) default NULL, `role` enum('READ ONLY','Regular','Admin') NOT NULL default 'Regular', PRIMARY KEY (`userid`), KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Dumping data for table `users` -- INSERT INTO `users` (`userid`, `username`, `password`, `role`) VALUES (1, 'admin', '5f4dcc3b5aa765d61d8327deb882cf99', 'Admin'), (2, 'singersoll', '2372507193e04f5cbcdf47dc56c14a2c', 'Admin'), (3, 'shanna', '5f4dcc3b5aa765d61d8327deb882cf99', 'Regular'); Your credentials are: shanna/password (this will be deleted once I get all working for testing) I have modified the conf.ini file to show table, copied your registration folder and placed under tables. I also moved the ApplicationDelegate.php to the conf folder. When attempting to login as shanna (regular) or admin (admin) I just get cycled back to the login form. If I move the ApplicationDelegate.php file from under the conf folder then I can obviously see my table tabs but still cannot access the registration form. Any thoughts why the login is not working correctly? TIA, Steve
A couple of things:
1. Make sure you add the .htaccess file to the application directory to prevent people from seeing your conf.ini file. 2. Check your error log to see if there is an error showing up somewhere.. like not being able to write to a session directory. Hopefully there is an error that we can go on here. -Steve
I had AllowOverride set to AuthConfig. Once I set to "All", changed permissions on .htaccess then the application worked find here at work. I use .htaccess and .htpasswd on a number of other apps so understand the requirement.
Interesting note: I did the reverse as in this thread, tgz the application directory and did a sql dump. Set those up on my system here at work and the login worked correctly (once you login it shows the username, etc.). I am running RHEL 4.0 with php 4.39 here at work. Where it is not working at home is on FC6 with php 5. Hmmm... very strange. I am getting other bits and pieces of this finally together but am stumped on the login issue at home when I use the same dump file and application folders (permissions, etc.) Sorry for the many questions but after two weeks of my first application using your platform I am seeing some great potential. Will take a closer look at my other server login tonight. Thanks, Steve
oh.. by .htaccess file, I mean that your .htaccess file should have at least the contents discussed in the getting started tutorial. There is a sample .htaccess file in
dataface/site_skeleton/.htaccess Copy its contents into your .htaccess file... this is different than the Auth directives. Please let me know when you find out what is causing the problem... be sure to check the error log... i'm sure it must be showing something. -Steve
I deleted both the error_log and access_log contents then tried to login. Here are the relevant results ->
(error_log) [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [notice] Digest: generating secret for digest authentication ... [notice] Digest: done [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads. [notice] Apache/2.2.2 (Fedora) configured -- resuming normal operations (access_log_ "GET /dataface/plone.css HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/plone_menu.js HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /inspection/ HTTP/1.1" 200 46961 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/plone_javascript_variables.js.php HTTP/1.1" 200 284 "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/plone_javascripts.js HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /inspection/images/logo-small.jpg HTTP/1.1" 200 3844 "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/js/Dataface/ResultList.js HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/js/Dataface/Record.js HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/js/ajax.js HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/images/table.gif HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/images/bullet.gif HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/images/treeCollapsed.gif HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/images/view.gif HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/images/edit.gif HTTP/1.1" 304 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /inspection/index.php?-table=inspection_categories&-action=login&-cursor=0&-skip=0&-limit=30&-mode=list HTTP/1.1" 302 - "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /inspection/index.php?-table=inspection_categories&-action=login_prompt&-cursor=0&-skip=0&-limit=30&-mode=list HTTP/1.1" 200 4383 "http://nvang.com/inspection/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/plone_javascript_variables.js.php HTTP/1.1" 200 284 "http://nvang.com/inspection/index.php?-table=inspection_categories&-action=login_prompt&-cursor=0&-skip=0&-limit=30&-mode=list" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "POST /inspection/index.php HTTP/1.1" 302 - "http://nvang.com/inspection/index.php?-table=inspection_categories&-action=login_prompt&-cursor=0&-skip=0&-limit=30&-mode=list" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /dataface/plone_javascript_variables.js.php HTTP/1.1" 200 284 "http://nvang.com/inspection/index.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" "GET /inspection/index.php HTTP/1.1" 200 47015 "http://nvang.com/inspection/index.php?-table=inspection_categories&-action=login_prompt&-cursor=0&-skip=0&-limit=30&-mode=list" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" I know this is beyond Dataface but if you have any thoughts I would appreciate your input. TIA, Steve
Hmm.. it doesn't look like it is writing anything to the error log...
So it could be that the passwords are legitimately being rejected. Double check that the tables/users/fields.ini file was copied over. This is where the md5 encryption on the passwords is specified (e.g. in the [password] section it shoud say 'encryption=md5') Other than that, I'm at a loss. I would need to dig through the code and do some debugging in order to diagnose further.
12 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 13 guests |