Post-as-Author for Articles

Dear SPIP community

I've been adapting the backenf of SPIP for task management. I've found
the backend tweaking very straign-forward as it's consistent with the
rest of SPIP.

However, does anyone know how to create a form that can be submitted (by
administrators) to directly post as another user? The use case here is
to add articles (tasks) directly to a user.

This can be done already by creating an articlen, then removing the
current author, and adding another one. I tried submitting the id_auteur
criteria to the article-create-form, but it only accepts id_rubrique etc.

Looking forward
Urs

--
Urs Riggenbach
GoSol - Solar Energy for All
Weissensteinstrasse 76
4500 Solothurn
+41 79 918 0663
www.gosol.org

Important: This email is confidential and may be privileged. If you are not the intended recipient, please delete it and notify us immediately; you should not copy or use it for any purpose, nor disclose its contents to any other person. Thank you.

Hi,

there is several ways to do this.

My prefered one is to create a specific object with the plugin « Factory » (http://contrib.spip.net/La-Fabrique), and stop using the articles.
You can then directly insert (in the last step of the form processing) your author in the table « spip_auteur_liens », to link the chosen author to the object that you have just created. (http://programmer.spip.net/-PHP-processing-)

When you are mapping articles to another object, you can use the pipeline « post-edition » to do the same thing. (http://programmer.spip.net/-Hooks-)

Hope it helps,

.Gilles

Dear SPIP community

I’ve been making great progress at learning SPIP and successfully managed to gather form input and create new users with custom fields in the front end. The idea here is that people can suggest users of the site.

Now I want to send out a link to these newly created users that automatically logs them in. (people only need to use the site once, so no need for them to have a password)

To log them in automatically, I can send them a “password forgotten” link, but that asks them to make a new password first, the log in with it, and only then they are ready to use the site.

Is there a way to create the login cookie upon visiting the site through a specific link. A link that logs them in directly?

Best wishes,
Urs Riggenbach

Yes it’s possible : just look the code that handles the temporary token (« jeton » in french) and returns the password form.

The change you have to do is to log-in your user with this token, and erase the token after that.

Hi All

I have 300 test accounts on my site. When I delete them from the DB and
create a new author, it's id_auteur is 301, instead of the next free one
which would be 2. Where does SPIP keep track of the authors it's made
and how can I reset it?

Wishing a great weekend,
Urs

Urs Riggenbach a écrit le 29/05/2015 19:27 :

Hi All

I have 300 test accounts on my site. When I delete them from the DB and
create a new author, it's id_auteur is 301, instead of the next free one
which would be 2. Where does SPIP keep track of the authors it's made
and how can I reset it?

This is not SPIP !
This is normal operation with Databases : Id are unique, even if you delete one, it can't be resused.

--
RealET

Hello,
If you are using MySQL see a page like
http://viralpatel.net/blogs/reseting-mysql-autoincrement-column/
on how to do it. But as Jacques has explained you need to do this in MySQL; you cannot do it with SPIP.

Paolo

On 29/05/15 19:27, Urs Riggenbach wrote:

Hi All

I have 300 test accounts on my site. When I delete them from the DB and
create a new author, it's id_auteur is 301, instead of the next free one
which would be 2. Where does SPIP keep track of the authors it's made
and how can I reset it?

Wishing a great weekend,
Urs