<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AAuthentication_API</id>
	<title>Development:Authentication API - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AAuthentication_API"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Authentication_API&amp;action=history"/>
	<updated>2026-05-06T20:47:04Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Authentication_API&amp;diff=10812&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Authentication_API&amp;diff=10812&amp;oldid=prev"/>
		<updated>2024-10-21T08:50:59Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:50, 21 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Authentication_API&amp;diff=10811&amp;oldid=prev</id>
		<title>1&gt;Wmasterj в 07:18, 12 апреля 2011</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Authentication_API&amp;diff=10811&amp;oldid=prev"/>
		<updated>2011-04-12T07:18:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;Authentication API&amp;#039;&amp;#039;&amp;#039; describes Moodle&amp;#039;s interface functions to authentication plugins. &lt;br /&gt;
(This page is incomplete , I&amp;#039;ll update it after I have phpdoc commented auth/ldap/lib.php)&lt;br /&gt;
&lt;br /&gt;
Most of the functions are from the [[LDAP_authentication|ldap-authentication module]] and are not implemented (yet?) on other modules. Please feel free to extend other modules to support same features or roll your own module.&lt;br /&gt;
&lt;br /&gt;
Some of new function are still tested and are not documented here yet.&lt;br /&gt;
&lt;br /&gt;
==Authentication functions==&lt;br /&gt;
&lt;br /&gt;
Basic functions to authenticate users with external db&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Mandatory:===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_user_login ($username, $password)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Authenticate username, password with userdatabase.&lt;br /&gt;
&lt;br /&gt;
;Returns:true if the username and password work and false if they don&amp;#039;t&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Optional:===&lt;br /&gt;
&lt;br /&gt;
The following functions are optional , but if present they extend module usability with Moodle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_get_userinfo($username)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Query other userinformation from database.&lt;br /&gt;
&lt;br /&gt;
;Returns:User information in array &amp;#039;&amp;#039;(name =&amp;gt; value, ...)&amp;#039;&amp;#039; or &amp;#039;&amp;#039;false&amp;#039;&amp;#039; in case of error. Function honors update-flags so if  &amp;lt;code&amp;gt;$CFG-&amp;gt;auth_user_(atribute)_updatelocal&amp;lt;/code&amp;gt; is present, it will return value only if flag is true.&lt;br /&gt;
&lt;br /&gt;
===COURSE CREATING===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_iscreator($username)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
should user have rights to create courses&lt;br /&gt;
&lt;br /&gt;
;Returns:&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if user has rights to create cources otherwise false&lt;br /&gt;
&lt;br /&gt;
===USER CREATION===&lt;br /&gt;
&lt;br /&gt;
Functions that enable user creation, activation and deactivation from moodle to external database&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_user_exists ($username)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checks if given username exists on external db&lt;br /&gt;
&lt;br /&gt;
;Returns:&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if given usernname exist or false&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_user_create ($userobject,$plainpass)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Creates new user to external db. User should be created in inactive stage until confirmed by email.&lt;br /&gt;
&lt;br /&gt;
;Returns:&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; on success otherwise &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_user_activate ($username)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
activate new user after email-address is confirmed&lt;br /&gt;
&lt;br /&gt;
;Returns:&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; on success otherwise &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_user_disable ($username)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
deactivate user in external db.&lt;br /&gt;
&lt;br /&gt;
;Returns:&amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; on success otherwise &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== USER INFORMATION AND SYNCRONIZATION ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_get_userlist ()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get list of usernames in external db.&lt;br /&gt;
&lt;br /&gt;
;Returns:All usernames in array or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; on error.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;auth_get_users($filter=&amp;#039;*&amp;#039;)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Get ALL USEROBJECTS FROM EXTERNAL DB.&lt;br /&gt;
&lt;br /&gt;
;Returns:Array of all users as objects from external db &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Authentication plugins]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=102070 Overview of entire authentication code flow] forum discussion&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?id=42 User authentication forum]&lt;br /&gt;
* Moodle Docs [[Manage authentication]]&lt;br /&gt;
* [[Authentication FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Authentication API]]&lt;br /&gt;
[[Category:Authentication]]&lt;br /&gt;
&lt;br /&gt;
[[ru:Development:API Аутентификации]]&lt;/div&gt;</summary>
		<author><name>1&gt;Wmasterj</name></author>
	</entry>
</feed>