create user http://dev.libresource.org/home/community/forum/b4326eccc0a8001e00d959578b4bbebd RE : create user http://dev.libresource.org/home/community/forum/b4326eccc0a8001e00d959578b4bbebd/b7c446e8c0a8001e00a1f85336c2ba12 Florent Jouille 2006-06-09T09:49:21+02:00 " I prefer to remove CreateUser function from the main page ..."

To remove the "CreateUser" action, go to web.xml in $LS_SRC_DIR/Src/LS-Client/Default-WebApp/WEB-INF/web.xml and find the block :

<!-- CreateUser -->
    <servlet>
        <servlet-name>CreateUser</servlet-name>
        <servlet-class>org.libresource.web.servlets.CreateUser</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>CreateUser</servlet-name>
        <url-pattern>/CreateUser</url-pattern>
    </servlet-mapping>

… and comment it :

<!-- CreateUser -->
    <!-- <servlet>
        <servlet-name>CreateUser</servlet-name>
        <servlet-class>org.libresource.web.servlets.CreateUser</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>CreateUser</servlet-name>
        <url-pattern>/CreateUser</url-pattern>
    </servlet-mapping> -->

Then, you need to re-compile and re-deploy the application.


" ...and to create users in the database by using a script."

The users are stored in the table " user_ " in the libresource database. You can display the description of the table with the following commands :

[libresource@localhost libresource]$  psql  libresource
libresource=# \d user_ 

username_ is the primary key (not null, unique).

password_digest_ is the md5 hash of the user password.

I give you a java class : here

This class will generate you the correct md5 hash for LibreSource :

libresource@localhost:~/md5$ ls
total 4
LSMD5Encoder.java
libresource@localhost:~/md5$ javac LSMD5Encoder.java
libresource@localhost:~/md5$ java LSMD5Encoder password
LS password hash for 'password' = 5f4dffffffcc3b5affffffa765ffffffd61dffffff8327ffffffdeffffffb8ffffff82ffffffcfffffff99
]]>
create user http://dev.libresource.org/home/community/forum/b4326eccc0a8001e00d959578b4bbebd/b4326ee2c0a8001e01ff7a73264fd558 Eric Leclercq 2006-06-08T17:11:12+02:00 I prefer to remove CreateUser function from the main page and to create users in the database by using a script.

Can you guide me to do this modification ?

Regards Eric LECLERCQ]]>