1. Generate Moodle password
For generating a moodle password , first of all include the the configuration page then use the script given below
$password = “new password”; $moodle_password = md5($password.$CFG->passwordsaltmain);
$password is the actual password and the passwordsaltmain is a hash key generated at moodle installation.
原文: http://php-experts-code.blogspot.com/2011/03/generate-moodle-password.html
另一种方法是:
$moodle_password = hash_internal_user_password($password);
完全一样的效果!
2. phpCAS error: phpCAS::client(): type mismatched for parameter $server_version (should be `string') in C:\xmoodle\moodle\auth\cas\auth.php on line 170
这个关键在于属性"mnethostid", 这个值默认是0, 但是应该让其为1, 所以添加一个新的user,应该是:
$person = new StdClass(); $person->auth = 'manual'; $person->confirmed = 1; $person->mnethostid = 1; // 重点 $person->lastlogin = time(); $person->currentlogin = time(); $person->username = "newperson"; $person->password = hash_internal_user_password('newperson'); //$person->idnumber = $person->username; $person->firstname = "newperson"; $person->lastname = "liang"; $person->email = "newperson@gmail.com"; $person->city = "sf"; $person->country = "US"; $person->lang = "en"; echo $person->id = $DB->insert_record('user', $person);
也可以去参考 https://moodle.org/mod/forum/discuss.php?d=73451, 可能会有其他的办法解决。
相关推荐
文章链接:https://blog.csdn.net/sinat_39620217/article/details/124390928 微信机器人码源,python自动化高效办公第二期,带你项目实战【二】{数据可视化、发送邮件(定时任务监控)、python聊天机器
Ruby Quick Syntax Reference.pdf Ruby速查手册,Ruby这语言听起来就很酷! 英文PDF版本,欢迎下载!
Ⅰ:Error Reporting 错误报告 A:Violations Associated with Buses 有关总线电气错误的各类型(共12项) ◆bus indices out of range 总线分支索引超出范围 ◆Bus range syntax errors 总线范围的语法错误 ◆...
今天小编就为大家分享一篇python使用wxpy轻松实现微信防撤回的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
Type mismatch in parameter xxx ----------------参数xxx类型不匹配 Type mismatch in redeclaration of ''xxx'' ---------------- xxx重定义的类型不匹配 Unable to create output file ''xxx'' ---------------...
三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。三思笔记Rman。...
Continuous nonsingular terminal sliding mode control for systems with mismatched disturbances
A subspace learning-based method for JPEG mismatched steganalysis
Decentralized Stabilization for Nonlinear Systems with Unknown Mismatched Interconnections
用于修复 Package xxx has mismatched uid 错误。 修复了 UID: readonly variable 错误
Disturbance rejection for nonlinear systems with mismatched disturbances based on disturbance observer
So you write a program to do it for you. The conference has multiple tracks each of which has a morning and afternoon session. Each session contains multiple talks. Morning sessions begin at 9am and...
支持中缀二元和前缀一元运算支持任意对分组符号错误格式如下: Syntax Error: token <+> followed by <+> (1+1)++(2/3) ^^ Syntax Error: Mismatched groupers: <(> <]> (1 + 1] ^ ^积极的发展正在进行...
error[E0308]: mismatched types --> src/format.rs:52:1 | 51 | ) -> Option<String> { | -------------- expected `Option<String>` because of return type 52 | / for ann in annotations { 53 | | match...
Global accurate stabilization for lower-triangular systems of high relative degree with mismatched disturbances
Integral sliding mode control for non-linear systems with mismatched uncertainty based on quadratic sliding mode
在分析现有基于agent的入侵检测系统(IDS)基础上,提出了一种基于证据推理的多agent分布式两级IDS模型。该模型采用分布检测、分布响应的模式,通过多agent技术的思想建立系统总体结构,给出了模型的各个组成部分,...
(Delimited::mismatched("abc<<12*&def", "<<", "*&"), Some(12)); 消耗定界 下面显示了如何将Delimited实例与consumpt_matched一起使用,以从字符串中提取两个不同的定界值。 let mut d = Delimited::...
配置错误可能会导致意外或错误的服务网格行为,可以使用此工具轻松检测并修复该错误。 istio-vet工具调用一个独立的vetters列表。 每个vetter对配置的子集执行验证,并生成关于任何错误配置的notes 。 请注意,...
Distributed Target Detectors With Capabilities of Mismatched Subspace Signal Rejection