Connect drupal site to moodle site - drupal

I am using drupal 7.27 version in which I need to connect to moodle site and its database. So I used drupal module moodle_connection to connect it withmoodle site. As it does not offer any end feature functionality. I installed another module called moodle_views but unfortunately there is no data received from the moodle. When I debug I found that connection does not establish between both the sites.
I am calling moodle_connector_connect() function in custom module to connect to Moodle. But no success. And in the moodle connector settings I put the following information:
Database Type : mysql
Database Server : localhost
Database TCP Port : 3306
Database Name : drupal_moodle ('Name of the moodle database')
Database Prefix : mdl_
Database User : root
Database Password : (I don't have password for my database user so I kept blank)
Moodle URL : drupal_moodle (Moodle site url)
Please help me to get out of this.
Regards
Neha

Reading over the bug reports in the Drupal module moodle_connector, I noticed some issues related to setting values for the moodle database connection variables, and some issues with handling error conditions.
Combine this with your mention of blank password, suggests the following line might be a problem.
Reading moodle_connector.module, around line 51 I notice some lazy checking for unset parameters.
// Return false if settings are incomplete.
if (!$type || !$server || !$port || !$username || !$password || !$database) {
return FALSE;
}
It looks like the check for !$password will cause the function moodle_connector_connect() to exit and not connect to the moodle database if any of the values are unset or empty.
As a workaround, and a step in right direction security-wise, could you create a new MySQL user, specifically grant it the necessary privileges to allow Drupal to read the Moodle DB and set a password.
I would also strongly advise that you read over the MySQL 'post installation' section of the manual which advises setting a password on the root user accounts. Having no root password is convenient during initial installation, but is a security problem. Any ordinary user on the machine, or a nearby machine which can connect to port 3306, could gain full access to the database.
http://dev.mysql.com/doc/refman/5.1/en/postinstallation.html

Related

Wordpress Bitnami MySQL(PhpMyAdmin) reset password on windows

I got to work on project using Wordpress Bitnami stack. Original developer does not remember password for root user for MySQL database. I tried to follow the steps on Bitnami website.
https://docs.bitnami.com/installer/apps/wordpress/administration/change-reset-password/
It seems like everything went throught but I am still not able to access the database using root user.
This is whats inside my mysql-init.txt
ALTER USER 'root'#'localhost' IDENTIFIED BY 'mypass';
Server's response is that this file have been executed but nothing.
I tried to change mysql-init.txt to following
ALTER USER 'root'#'localhost' IDENTIFIED BY 'mypass';
CREATE USER 'admin'#'localhost' IDENTIFIED BY 'mypass';
FLUSH PRIVILEGES;
After this went throught I am able to access the database using Admin user but my root password does not work. That means file have been executed correctly it just does not update my root password for some reason.
Stack is on Win 10
DB:Distrib 5.7.24, for Win32 on AMD64
Command to run DB with init file:
C:\Bitnami\wordpress-4.9.8-2\mysql\bin\mysqld.exe --defaults-file="C:\Bitnami\wordpress-4.9.8-2\mysql\my.ini" --init-file="C:\Bitnami\wordpress-4.9.8-2\mysql\mysql-init.txt" --console
The problem was in the mysql-init.txt file. Somehow I got a new line at the end of the password.
Very strange issue but hey Its solved.
ALTER USER 'root'#'localhost' IDENTIFIED BY 'mypass[Here was a new line]';
FLUSH PRIVILEGES;

JDG on OpenShift Online - HotRodClientException despite proper permissions assigned to roles

I deployed JDG on OpenShift Online with the following
- Image stream "jboss-datagrid71-openshift-rhel7.json" v1.2
- username 'admin' with role 'admin' and '___schema_manager'
- And given the permissions of READ, WRITE, EXEC, ADMIN, ALL for both the roles. Tried with just 'ALL' also.
- Refer images, Config-env-vars.png and Cache-env-vars.png within the Info.zip for the environment configurations done. (Available # https://drive.google.com/file/d/12EWF1AUB4d60mP_gmTkN4Qlh2pzzv6xi/view?usp=sharing)
While deploying client-side Java application (basically Hotrod with security enabled and with Protobuf based query feature), we are getting the following exception. Attached the logs from the DataGrid server and client application pods
Caused by: org.infinispan.client.hotrod.exceptions.HotRodClientException: java.lang.SecurityException: ISPN000287: Unauthorized access: subject 'Subject with principal(s): [SimpleUserPrincipal [name=admin], InetAddressPrincipal [address=10.131.14.124/10.131.14.124], admin#ApplicationRealm, admin#ApplicationRealm, ___schema_manager#ApplicationRealm, admin, ___schema_manager]' lacks 'WRITE' permission
FYI,
I use the following version of Infinispan from redhat repository
<version.org.infinispan>8.4.2.Final-redhat-1</version.org.infinispan>
In Java, while creating a Configuration Builder, I did in this way. Full code is available # https://github.com/techtantric/JDG-Remote-Hotrod-Secured
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer()
.host(host)
.port(hotrodPort).security().authentication().serverName("jdg-server").saslMechanism("DIGEST-MD5").callbackHandler(new LoginHandler("admin", "password".toCharArray(), "ApplicationRealm")).enable()
.marshaller(new ProtoStreamMarshaller()); // The Protobuf based marshaller is required for query capabilities
cacheManager = new RemoteCacheManager(builder.build());
Please help us resolving this issue. Thanks in advance.
You should not be touching the ___schema_manager role.

How can I change entire URL when transfer same WordPress database to another domain database?

I have a WordPress site called: www.myfirstwp.com.
I want to transfer it's database to new domain which is www.mynewwp.com.
I did it by exporting the DB from www.myfirstwp.com and imported it to www.mynewwp.com
But in this new site ( www.mynewwp.com ) database have all old one database URL.
So, How can I change entire url of old one (www.myfirstwp.com) database in new one ( www.mynewwp.com ) database? Is there any way to do this?
Thank You.
Update Question :
I have an issue in WordPress. When I try to importing XML file with Attachments it's showing me following error message :
Error Message :
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Apache Server at mysite.com Port 80
what should I do to solve this type of error message as I am a new user in WordPress.
Thank You.
NOTE: before you tinker with your database be sure to grab a backup first. You do not want to mess up a production database.
The simple way is to open the database on your new domain, open {$prefix}_options and change the home and siteurl rows to reflect the new domain.
This approach works and allows you to operate the site at minimum. The other problems include:
Embedded media links which use the old domain
Other post meta fields and option fields that may contain the old domain.
What I do when this happens is to use raw SQL inside phpMyAdmin (or similar) to search and replace. The following queries take care of post meta and options (95% of the time):
UPDATE wp_options SET option_value = REPLACE(option_value, 'olddomain.com', 'newdomain.com');
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'olddomain.com', 'newdomain.com');
The following tables and columns usually have contained domain references in WP:
wp_options.option_value
wp_postmeta.meta_value
wp_posts.post_content
wp_posts.guid
But there might be more places where the domain has been inserted.

Not able to get nJupiter.DataAccess.Ldap work with our Internal LDAP (Lotus Domino)

I've tried everything possible, to setup nJupiter.DataAccess.Ldap as the membership provider on our intranet based web application built using asp.net 3.5.
Challenges I am facing:
Not able to authenticate the user using the default login webpart (says Your login attempt was not successful. Please try again)
I tried this code and I receive a COMException : "There is no such object on the server."
var ldapMembershipUser = System.Web.Security.Membership.GetUser("username") as LdapMembershipUser;
if (ldapMembershipUser != null)
{
var givenName = ldapMembershipUser.Attributes["givenName"];
}
I have placed my web.config and the nJupiter.DataAccess.Ldap.config here:
web.config : http://pastebin.com/9XdDnhUH
nJupiter.DataAccess.Ldap.config : http://pastebin.com/WsSEhi98
I have tried all possible permutations and combinations for different values in the XML and i am not able to take it forward. Please guide. I just am not able to connec to the LDAP and authenticate the user or even search for users.
Just looking at your config is unlikely to be enough since I don't know your Domino server's confguration, so my answer isn't an attempt to fix your problem. It's an attempt to teach you how I would approach it if it were my problem. Here's what I do to troubleshoot connections and queries from code to Domino LDAP:
Configure the Domino LDAP server for logging the highest level of debug information with the notes.ini setting LDAPDEBUG=7. See this IBM technote for more info.
Use an LDAP client and figure out how to successfully connect to the Domino LDAP server. I like the free Softerra client for this. Check the logs and save off the info from your successful connection.
Now run your code and compare what you see in the logs against the successful connection.
If the code is making it past authentication but failing on the query, then find the actual query in the log, go back to your LDAP client, figure out what the query should have been, and adjust your code's configuration appropriately.

How to Resolve "Error Establishing a Database Connection" on WordPress XAMPP Localhost for Google App Engine

Following Google App Engine's instructions for creating a local WordPress development platform, I created the database and initial user using the instruction's MySQL direction:
CREATE DATABASE IF NOT EXISTS wordpress_db;
CREATE USER 'wp_user'#'localhost' IDENTIFIED BY 'wp_password';
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'#'localhost';
After running it without errors reported, MySQL subsequently reported back:
CREATE DATABASE IF NOT EXISTS wordpress_db;# 1 row affected.
CREATE USER 'wp_user'#'localhost' IDENTIFIED BY 'wp_password';# MySQL returned an empty result set (i.e. zero rows).
GRANT ALL PRIVILEGES ON wordpress_db.* TO 'wp_user'#'localhost';# MySQL returned an empty result set (i.e. zero rows).
While the command line runs dev_appserver.py, I try reaching the WordPress app and get instead:
Error establishing a database connection
I've removed and recreated the database (wordpress_db) and user (wp_user) without reaching the WP app.
Any suggestion how to resolve this is appreciated.
Thanks, this is my App Engine log:
2013-11-26 17:40:25 Running command: "['C:\Program Files\Python27\python.exe', u'C:\Program Files\Google\google_appengine\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=8080', '--admin_port=8000', u'C:\Documents and Settings\User\My Documents\Catalyx\Catalyx-GoogleAppEngine\Catalyx']"
2013-11-26 17:40:26 (Process exited with code -1073741515)
As you have mentioned you are following googles own instructions...
then in the section titled ...
Step 4. Create your wp-config.php configuration file
where the instructions state that you should replace the existing lines with the following:
/** The name of the database for WordPress */
define('DB_NAME', '**wordpress_db**');
/** MySQL database username */
define('DB_USER', '**wp_user**');
/** MySQL database password */
define('DB_PASSWORD', '**wp_password**');
You should enter those lines without the ** either side of the words like so...
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress_db');
/** MySQL database username */
define('DB_USER', 'wp_user');
/** MySQL database password */
define('DB_PASSWORD', 'wp_password');
When you hit the default root url for your local app - normally localhost:8080 you may get some odd redirects, so instead go direct to the local Wordpress install url...
http://localhost:8082/wp-admin/install.php
You should then get the nice Wordpress install page that you were expecting
This happens to me and I have a very 'good' evening with it. So hopefully someone can found this problem earlier...
I am trying to replicate the server wordpress on localhost. After replacing the actual URL with localhost, thing works perfectly. Except one thing, the newly created page is always in "Error Establishing a Database Connection”.
Let me put in sequence why this problem happened.
on local pc I already have an old wordpress directory wp/
on server my wordpress was placed under wp/
when i copy the package to my local pc, i placed it to wp2/ (remember wp/ already taken?)
So who's the culprit? it's the .htaccess
RewriteBase /wp/
So it pointing to another database used by wp, which is of course resulting in error!
The fix is easy, just change it to wp2!
RewriteBase /wp2/
Voila! Cheers and the evening suddenly become beautiful again! :)
To fix this problem try those fixes :
Open wp-config.php, check line DB_USER, DB_PASSWORD, DB_HOST, DB_NAME. Make sure the values is same with mysql access.
If you use Dedicated server or VPS hosting, try to restart your mysql server by typing :
-service mysql restart
or
-service mysql start
but if you use shared hosting, ignore this step!
if all the previous fixes can not fix it, so it's a server-side problem! it is not your error! so let the hosting company fix this error for you because it is their error!
contact them or give them a day or so and they will solve this error and the problem will disappear automatically.
you can also check this video for the error establishing database connection fixes

Resources