Hi!
Given a username, how do I know if a user with that username is already
registered? Is there a way to check, say isUserRegistered(username) or
User.isUserRegistered()?
Thank you very much.
-Allen
By the way, HAPPY NEW YEAR!
I've migrated a application from xwiki 1.7 to xwiki 2.1.1
The process i've executed is started with a clean distribution of xwiki2.0
If configured the wiki to multi language and that registration is required
Use of email verificatiion to "Yes"
Check Active fields for authentication to "Yes"
I've manually copied the scripts of welcome and confirmation to the
Validation e-mail content and Confirmation e-mail content
After that i've exported the wiki and importing the XAR; making sure I did not overwrite any document in XWiki space.
Testing the registration gives the following result (we use gmail as SMTP service)
User registers and receives the request for validation; result OK
User clicks on the link to activate the account
The website shows up OK
but the validation fails with message;
"There was a problem validationg your account, please contact a administrator"
The link in the email is the following;
http://cdlsworld.devxwiki.com/xwiki/bin/view/XWiki/AccountValidation?validk…
Since i'm hosting the site at XWIKI.com i have no access to the file system to check if the key is as expected from xwiki.cfg file
How to solve; help greatly appreciated
Gerritjan
Hello,
I've XWiki 2.0rc2 instance and I want to update to 2.0.5 version.
I find empty FAQ here:
http://www.xwiki.org/xwiki/bin/view/FAQ/WhoCanIUpdateXWIKIFromAnOlderVersion
I'd like to update it on myself experience.
But before I've one question at the end of my email on xar import.
1st/ re-deploy war (easy part)
By chance we didn't update any files excepted xwiki.cfg and hibernate.cfg.xml.
So I did the following:
- zip current webapp/xwiki folder
- remove webapp/xwiki folder
- deploy xwiki-enterprise-web-2.0.5.war in webapp/xwiki
- report my old xwiki.cfg and hibernate.cfg.xml configuration to the new one
2nd/ import xar (difficulties start here)
First, I import the full xar without any question: whao, everything is broken.
Do not forget to backup your database before upgrade!
After restoration, I decide to write a small script based on curl to
export same xar as the one I want to import:
#!/bin/bash
XWIKI_BASE_URL=http://localhost:8080
if [[ $# -ne 2 ]]; then
echo usage $0 login password
exit 1
fi
EXPORT_XAR="?format=xar&name=Current"
for page in `jar tvf xwiki-enterprise-wiki-2.0.5.xar | sed -ne
"/\/.*xml/{s/.*\s\(\S\+\)\/\(\S\+\).xml/\1.\2/ p}"`; do
EXPORT_XAR="${EXPORT_XAR}&pages=${page}"
done
curl -b cookies.txt -c cookies.txt
-d"j_username=$1&j_password=$2&j_rememberme=true&submit=Log-in"
${XWIKI_BASE_URL}/xwiki/bin/loginsubmit/XWiki/XWikiLogin
curl -b cookies.txt -c cookies.txt
${XWIKI_BASE_URL}/xwiki/bin/export/Main/WebHome${EXPORT_XAR} -o
Current.xar
Whatever I used the best diff tool (Beyond Compare IMHO), it is not so
easy to check if difference are good or not: I need other way.
Thanks to RESTful API, I write a second script which check page
version: version 1.1 was never updated from previous xar version:
#!/bin/bash
XWIKI_BASE_URL=http://localhost:8080
for page in `jar tvf xwiki-enterprise-wiki-2.0.5.xar | sed -ne
"/\/.*xml/{s/.*\s\(\S\+\)\/\(\S\+\).xml/\1\/pages\/\2/ p}"`; do
version=`curl -s -b cookies.txt -c cookies.txt
${XWIKI_BASE_URL}/xwiki/rest/wikis/xwiki/spaces/$page | sed -ne
"/version/{s/.*version>\(.*\)<\/version.*/\1/ p}"`
if [[ $version != "1.1" ]]; then
echo $page $version UPDATED
fi
done
Cool, only 8 updated pages:
Main/pages/WebHome 144.1 UPDATED
XWiki/pages/XWikiUserSheet 4.1 UPDATED
XWiki/pages/XWikiAdminGroup 4.2 UPDATED
XWiki/pages/XWikiPreferences 78.1 UPDATED
XWiki/pages/LiveTableResults 2.1 UPDATED
XWiki/pages/XWikiAllGroup 34.1 UPDATED
XWiki/pages/WebPreferences 3.2 UPDATED
XWiki/pages/LiveTableResultsMacros 2.1 UPDATED
All other pages can be updated without any check :-D
6 pages of 8 should be not updated:
- Main.WebHome: it is our own main page
- XWiki.AdminGroup and XWikiAllGroup: list Admin users and users
- XWiki.XWikiUserSheet, we apply a patch to display user
contribution: not updated
- XWiki.LiveTableResults and XWiki.LiveTableResultsMacros, I check
with my diff tool: there is a tag object inside.should not updated it.
But I block on XWiki.XWikiPreferences and XWiki.WebPreferences.
I want our own preferences, I should not update
But new preferences may be added
My diff tool find them too different.
Could I keep my old preferences or do I have to merge?
Regards,
Arnaud.