check_me(str,check){
    if(check_standard(str) && !check){
        write("Access Denied.\n");
        return 1;
    }
    if(check_standard(str) && !check_auth(check))
     {
        write("Access Denied.\n");
        return 1;
    }
    return 0;
}

check_standard(str) {
/*
write("PWD and STR are:  "+pwd+"\t"+str+"\n");
*/
     if(extract(pwd,0,3)=="room" ||
        extract(pwd,0,2)=="obj" ||
        extract(pwd,0,2)=="bin" ||
        extract(pwd,0,5)=="closed" ||
        extract(pwd,0,5)=="closed" ||
        extract(pwd,0,7)=="post_dir")
       return 1;
     if(extract(pwd,0,4)=="/room" ||
        extract(pwd,0,3)=="/obj" ||
        extract(pwd,0,3)=="/bin" ||
        extract(pwd,0,8)=="/post_dir" ||
        extract(pwd,0,6)=="/closed")
         return 1;
     if(extract(str,0,4)=="/room" ||
        extract(str,0,3)=="/obj" ||
        extract(str,0,3)=="/bin" ||
        extract(str,0,6)=="/closed")
       return 1;
     return 0;
}

int check_auth(string str)
{
 return (crypt(str, pcheck[0..1]) == pcheck);
}
