What is the use of sessions table in drupal? - drupal

What is the use of sessions table in drupal?
Sometimes this table is crashed, Can anyone please tell me the reason it is crashed?

The sessions table keeps track of user sessions on your site. This table should have an entry for every user that's logged in to your site. Some users may even have more than one session entry if they're logged in from different devices or even different browsers.
You can select the table and 'repair' it from your phpMyAdmin interface, or as a last resort manually empty it, but that will log out all users from your site. I hope this helps...
It's hard to know why it's crashing, but if it's happening very frequently, it sounds like a module you have installed may be causing problems. I'm assuming you haven't modified any code in Drupal core.

Related

WordPress - Contact Form 7 fields save to a different database

I know that there will be a database to be created at the initial configuration of CF7. I am wondering whether or not I can use a different database of my own (not the wordpress' database) in PHPMyAdmin, and is there an existing tutorial to do so?
Thank you.
That could have some serious unintended consequences. You'd be better off putting a hook in your submission to ALSO add the data to some other database.
The reason is that plugins are quite integrated and there are many things that it tracks at once including things related to the user who submits the form. If you orphan some of those records, it might be difficult to reconstruct things, build reports, and do other sorts of maintenance later.

Does PHPStorm display PL/SQL(triggers, views, etc)

I know that I've used it in the past and it did display the triggers but now it seams that it's not working. Does anyone know what's up?
the Database Navigator plugin does it. In case they disappeared all of a sudden, maybe there has been a permission change on the DB account you're using. Maybe the account lacks the permission to browse PL/SQL objects and so on.

A database search alternative to Views

Is there an alternative module or way that I can query a drupal database to return results from a table for example, the users table, and have the search results visible even for anonymous users? I have tried using the views module but only a logged in user is able to see the results. I have changed the access permissions to no avail. I am working with Drupal 6. Please help!!!
There is no reason a view should only show up to logged out users, unless the data being loaded in the view is not available to logged out users. The view itself has permissions. Assuming you're in Views 3 (though 2 is similar) and depending whether it is a page or a block, the middle column will have "Block Settings" or "Page Settings" under which one of the options is "Access". You can tie the view to a specific permission, use custom PHP, or specifically enable it for certain roles. You can also choose "none" here and completely bypass permissions -- then the view will be available to everyone to see the data in, regardless of their permission to the data itself. However, be careful with that if there's any sensitive data on your site.
Views is definitely the best way to create an advanced search in Drupal. I'm sure there are alternatives, but this is exactly what Views is for, and Views is the #1 tool and #1 reason people use Drupal. What I recommend is opening a new issue for help figuring out why your view does not show to anonymous users.

Redirect loop on non-admin login

I'm getting a redirect loop on a Drupal 7 install. Whenever a non-admin user logs in, the site will enter a redirect loop on the user profile URL; for example, http://example.com/?q=user/testuser.
This URL is accessible with no issues by the superuser account, and attempting to access this URL while logged out returns a 403 Access Denied as expected.
When logged in as a non-admin user, attempting to access any URL at all will redirect to the user profile page, which will then redirect onto itself, causing the redirect loop to start anew.
I have found that if I give a specific user the "administrator" role, the redirect loop will cease for that user, and the page will no longer try to redirect to user/%username on login.
I have also found that if I give users the "administer users" permission that the redirect loop will cease, but will still redirect the user to user/%username on login.
Obviously neither of these solutions are possible as giving regular users administrator roles or the ability to administer users is a huge security risk.
Does anyone know of a fix for this, or a way to get around this with an override related to user role?
Installed modules: Block, Color, Comment, Contextual links, Dashboard, Database logging, Field, Field SQL storage, Field UI, File, Filter, Help, Image, List, Menu, Node, Number, Options, Overlay, Path, RDF, Search, Shortcut, System, Taxonomy, Text, Toolbar, Update manager, User, Chaos tools (7.x-1.0-alpha4), Page manager, Devel, Theme Developer, Fieldgroup, IMCE, Pathauto, Token, Taxonomy Menu, IMCE Wysiwyg API bridge, Wysiwyg, Webform, and several custom modules which i) provide blocks 2) provide custom pages and 3) modify the default search behaviour (splits search results by node type). None of my custom modules ever interface with the user management system, permissions system or use any of the functions provided by the user module.
I had an identical problem... spurred on by the fact I wasn't the only one faced with this issue I dug around a bit more. It was your update that gave it away - the Custom Theme.
I'm sure this could be caused by lots of different factors, but in my case and potentially yours, it was my template.php that was at fault.
I was using a custom MYTHEME_preprocess_page() to make some custom variables available in my templates. One of the variables was obviously a bit funky because when i removed it the problem disappeared. Turns out it was some left over code from when I was trying to get the user registration form into the page. It never worked and I forgot to remove it!
Hope this helps someone out there get back on track.
I haven't solution, but you can investigate in next way:
1. Goto http://SITE/admin/config/development/devel for devel module settings.
2. Check "Display redirection page" and save settings.
3. Goto http://SITE/admin/people/permissions
4. Check "Access developer information" for anon and other roles, and save.
5. Try login, it should stop on redirection pages and show where it try to redirect, so you can detect, what modules call looping.
I also had a problem with redirect-loops randomly occurring for non-admin users. Looking at /admin/reports/dblog revealed a permission problem with several nodes. I fixed it by flushing the node permissions (see /admin/reports/status/rebuild). Now everything is fine again.
Same problem for me, after hours and hours of debug and forum/blog navigation I finally found what was going on my site...
If you force login block in all pages, even if user is already logged in, only admin can navigate pages.
This is one of the possibles causes, I hope can help someone!
I had the same problem because i was loading the login form even when the user was logged in. fix it by not asking for the form only if the user is anonymous.
from https://www.drupal.org/node/1793230
Run these SQL queries in your MySQL database. If you have drush installed, you can just "drush sqlc" from your settings directory to get into a MySQL command line. Otherwise you can use PHPMyAdmin, MySQL workbench, or some other client tool to connect and run these:
Show records to be deleted:
SELECT r.rid, r.language, r.source, r.redirect FROM redirect r INNER JOIN url_alias u ON r.source = u.alias AND r.redirect = u.source AND r.language = u.language;
Then, to delete redirects shown in above query - try going to the pages shown in the row. Chances are you will get a redirect loop. Then, try again after backing up db and running the delete below. You have to turn off safe mode in MYSQL Workbench to run it, so BACKUP:
DELETE r FROM redirect r INNER JOIN url_alias u ON r.source = u.alias AND r.redirect = u.source AND r.language = u.language;
Fixed my problem, and found other pages that had loops which I didn't even realize!

Problems with LDAP and Drupal

EDIT
(But please read it all if you really wanna help :) )
Since I'm able to view all the profiles with the correct LDAP data (it's fetched when asked for, but never stored), an possible, albeit hackish solution, would be to display all the profiles as a table. Does anyone have an idea how that might be done ? Google hasn't help, understandably since most people never need to use such a feature.
EDIT
I've successfully used the LDAP Integration module to use LDAP authentication with Drupal. Now I'm trying to create an address book with information from LDAP. I've tried the following solution:
Changed the ldap_data.module, the part that states which fields can be mapped between ldap and drupal (e.g. mail => mail). This fails when I try to add more mappings. I believe this maps to the "users" table in drupal, but when I try to add a field to that table and map a LDAP attribute to it, nothing goes into the database. My plan was to then use Table Wizard with views to create the address book. Using Table Wizard and Views I was able to extract everything I wanted from the users table, but the problem of entering data into the table is still not solved.
If you have any ideas, any at all, I'd really appreciate it. I'm a beginner in drupal and LDAP altogether btw. I've already tried to google this to death over the last few days but nothing has helped me solve this problem.
The answer below helped me understand why this didn't work, but the problem is still unsolved.
The LDAP Data module is not intended to work with fields arbitrarily added to the users table. Instead, it works in conjunction with the core Profiles module and can map to its fields.

Resources