version 1.102, 2005/06/06 00:06:12
|
version 1.106, 2005/06/23 21:56:12
|
Line 108 sub my_custom_roles {
|
Line 108 sub my_custom_roles {
|
|
|
sub authorpriv { |
sub authorpriv { |
my ($auname,$audom)=@_; |
my ($auname,$audom)=@_; |
if (($auname ne $env{'user.name'}) || |
unless ((&Apache::lonnet::allowed('cca',$audom.'/'.$auname)) |
(($audom ne $env{'user.domain'}) && |
|| (&Apache::lonnet::allowed('caa',$audom.'/'.$auname))) { return ''; } |
($audom ne $env{'request.role.domain'}))) { return ''; } |
|
unless (&Apache::lonnet::allowed('cca',$audom)) { return ''; } |
|
return 1; |
return 1; |
} |
} |
|
|
Line 158 $lt{'dom'}:</td><td>$domform</td></tr>
|
Line 156 $lt{'dom'}:</td><td>$domform</td></tr>
|
</table> |
</table> |
<input name="userrole" type="submit" value="$lt{usrr}" /> |
<input name="userrole" type="submit" value="$lt{usrr}" /> |
</form> |
</form> |
|
ENDDOCUMENT |
|
if (&Apache::lonnet::allowed('mcr','/')) { |
|
$r->print(<<ENDCUSTOM); |
<form action="/adm/createuser" method="post" name="docustom"> |
<form action="/adm/createuser" method="post" name="docustom"> |
<input type="hidden" name="phase" value="selected_custom_edit"> |
<input type="hidden" name="phase" value="selected_custom_edit"> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
Line 165 $lt{'nr'}: $choice <input type="text" si
|
Line 166 $lt{'nr'}: $choice <input type="text" si
|
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
</body> |
</body> |
</html> |
</html> |
ENDDOCUMENT |
ENDCUSTOM |
|
} |
} |
} |
|
|
# =================================================================== Phase two |
# =================================================================== Phase two |
Line 574 END
|
Line 576 END
|
$class='Domain'; |
$class='Domain'; |
} |
} |
} |
} |
if ($role_code eq 'ca') { |
if (($role_code eq 'ca') || ($role_code eq 'aa')) { |
$area=~/\/(\w+)\/(\w+)/; |
$area=~/\/(\w+)\/(\w+)/; |
if (&authorpriv($2,$1)) { |
if (&authorpriv($2,$1)) { |
$allowed=1; |
$allowed=1; |
Line 778 ENDOTHERAUTHS
|
Line 780 ENDOTHERAUTHS
|
'sta' => "Start", |
'sta' => "Start", |
'end' => "End", |
'end' => "End", |
'cau' => "Co-Author", |
'cau' => "Co-Author", |
|
'caa' => "Assistant Co-Author", |
'ssd' => "Set Start Date", |
'ssd' => "Set Start Date", |
'sed' => "Set End Date" |
'sed' => "Set End Date" |
); |
); |
Line 796 ENDOTHERAUTHS
|
Line 799 ENDOTHERAUTHS
|
<a href= |
<a href= |
"javascript:pjump('date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset')">$lt{'sed'}</a></td> |
</tr> |
</tr> |
|
<tr> |
|
<td><input type=checkbox name="act_$cudom\_$cuname\_aa" /></td> |
|
<td>$lt{'caa'}</td> |
|
<td>$cudom\_$cuname</td> |
|
<td><input type=hidden name="start_$cudom\_$cuname\_aa" value='' /> |
|
<a href= |
|
"javascript:pjump('date_start','Start Date Assistant Co-Author',document.cu.start_$cudom\_$cuname\_aa.value,'start_$cudom\_$cuname\_aa','cu.pres','dateset')">$lt{'ssd'}</a></td> |
|
<td><input type=hidden name="end_$cudom\_$cuname\_aa" value='' /> |
|
<a href= |
|
"javascript:pjump('date_end','End Date Assistant Co-Author',document.cu.end_$cudom\_$cuname\_aa.value,'end_$cudom\_$cuname\_aa','cu.pres','dateset')">$lt{'sed'}</a></td> |
|
</tr> |
</table> |
</table> |
ENDCOAUTH |
ENDCOAUTH |
} |
} |
Line 1251 END
|
Line 1265 END
|
} # End of foreach (keys(%env)) |
} # End of foreach (keys(%env)) |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
&Apache::lonnet::flushcourselogs(); |
&Apache::lonnet::flushcourselogs(); |
|
$r->print('<p><a href="/adm/createuser">Create/Modify Another User</a></p>'); |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
} |
} |
|
|
Line 1552 sub handler {
|
Line 1567 sub handler {
|
(&Apache::lonnet::allowed('cin',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('cin',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('ccr',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('ccr',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('cep',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('cep',$env{'request.course.id'})) || |
(&Apache::lonnet::allowed('cca',$env{'request.role.domain'})) || |
(&authorpriv($env{'user.name'},$env{'request.role.domain'})) || |
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |