This is insufficient information for us to help you. Please do some debugging. Print these two:
$cek=substr($this->getAttribute($attribute),0,2);
$ricek=user::model()->kode_prop;
what is kode_prop and where is it defined.
!!!Also please note that you are comparing not only the value but also the type of the data ($cek!==$ricek) try $cek!=$ricek and see if it works that way