I own a Samsung Spica GT-i5700, how can I disable the power-off menu when the phone is locked. I am running CM7.
This feature is in Cerberus Anti Theft and also in some custom android Roms (Such as Exodous). It doesn't require root but like any anti-theft software there is a paid version as the free one is limited to 30 days. But you could try the Smart Screen Protector App which is also mentioned in one of the other answers.
Try the Smart Screen Protector application from the play store. It claims to disable the lock key when the screen is locked even with the pin. Doesn't require a ROOT device
If it does not work then you can increase the delay time as suggested by the app.